Spaces:
Runtime error
Runtime error
dennis-fast
commited on
Commit
•
110cf2a
1
Parent(s):
d7e3201
Update app.py
Browse files
app.py
CHANGED
@@ -24,14 +24,16 @@ def predict(input, history=[]):
|
|
24 |
pad_token_id=tokenizer.eos_token_id,
|
25 |
#no_repeat_ngram_size=3,
|
26 |
#do_sample=True,
|
27 |
-
#top_k=100,
|
28 |
-
#top_p=0.7,
|
29 |
#temperature = 0.8
|
|
|
|
|
30 |
).tolist()
|
31 |
|
32 |
# convert the tokens to text, and then split the responses into the right format
|
33 |
response = tokenizer.decode(history[0]).split("<|endoftext|>")
|
34 |
response = [(response[i], response[i+1]) for i in range(0, len(response)-1, 2)] # convert to tuples of list
|
|
|
|
|
35 |
return response, history
|
36 |
|
37 |
gr.Interface(fn=predict,
|
|
|
24 |
pad_token_id=tokenizer.eos_token_id,
|
25 |
#no_repeat_ngram_size=3,
|
26 |
#do_sample=True,
|
|
|
|
|
27 |
#temperature = 0.8
|
28 |
+
top_p=0.92,
|
29 |
+
top_k = 50
|
30 |
).tolist()
|
31 |
|
32 |
# convert the tokens to text, and then split the responses into the right format
|
33 |
response = tokenizer.decode(history[0]).split("<|endoftext|>")
|
34 |
response = [(response[i], response[i+1]) for i in range(0, len(response)-1, 2)] # convert to tuples of list
|
35 |
+
print(response)
|
36 |
+
print(history)
|
37 |
return response, history
|
38 |
|
39 |
gr.Interface(fn=predict,
|