"tools/dist_train.sh" did not exist on "a9a1fe81764d781f5f355c10a4d551e3092a1180"
gpt2.h 756 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef GPT2_H
#define GPT2_H

#include <cstdint>
#include <string>
#include <migraphx/program.hpp>
#include <CommonDefinition.h>
#include <tokenization.h>

namespace migraphxSamples
{
    typedef struct _Predictions
    {
        long unsigned int index;
        float predictionvalue;
    }Predictions;

class GPT2
{

public:
    GPT2();
    
    ~GPT2();

liucong's avatar
liucong committed
26
    ErrorCode Initialize();
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

    ErrorCode Preprocessing(cuBERT::FullTokenizer tokenizer,
                             char *question,
                             std::vector<long unsigned int> &input_id);

    long unsigned int Inference(const std::vector<long unsigned int> &input_id);

private:
    migraphx::program net;
    std::string inputName;
    migraphx::shape inputShape;
};

}
#endif