Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,9 +10,11 @@ OAI_API_KEY=os.getenv("OPENAI_API_KEY")
|
|
10 |
#login(token=HUGGINGFACEHUB_API_TOKEN)
|
11 |
|
12 |
# tokenizer for generating prompt
|
|
|
13 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-70b-chat-hf")
|
14 |
|
15 |
# inference client
|
|
|
16 |
client = InferenceClient("https://api-inference.huggingface.co/models/meta-llama/Llama-2-70b-chat-hf")
|
17 |
|
18 |
# generate function
|
@@ -26,6 +28,7 @@ def generate(text):
|
|
26 |
top_p=0.9,
|
27 |
temperature=0.6,
|
28 |
)
|
|
|
29 |
return res.strip()
|
30 |
|
31 |
# test client
|
|
|
10 |
#login(token=HUGGINGFACEHUB_API_TOKEN)
|
11 |
|
12 |
# tokenizer for generating prompt
|
13 |
+
print ("Tokenizer")
|
14 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-70b-chat-hf")
|
15 |
|
16 |
# inference client
|
17 |
+
print ("Inf.Client")
|
18 |
client = InferenceClient("https://api-inference.huggingface.co/models/meta-llama/Llama-2-70b-chat-hf")
|
19 |
|
20 |
# generate function
|
|
|
28 |
top_p=0.9,
|
29 |
temperature=0.6,
|
30 |
)
|
31 |
+
print (res)
|
32 |
return res.strip()
|
33 |
|
34 |
# test client
|