rxl7906 commited on
Commit
8d81e54
·
1 Parent(s): 9b13035

Upload client.py

Browse files
Files changed (1) hide show
  1. client.py +14 -0
client.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ from transformers import AutoTokenizer, CodeGenTokenizer, GPTJForCausalLM, CodeGenConfig, CodeGenModel
3
+ import torch
4
+
5
+ model_name = "rxl7906/codegen-350M-mono-gptj"
6
+
7
+ model = GPTJForCausalLM.from_pretrained(model_name)
8
+ tokenizer = CodeGenTokenizer.from_pretrained(model_name)
9
+
10
+ classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
11
+
12
+ res = classifier("I've been waiting for a HuggingFace course my whole life!")
13
+
14
+ print(res)