Di Zhang
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def generate_text(message, history, max_tokens=512, temperature=0.9, top_p=0.95)
|
|
37 |
input_texts = [input_text.replace('<|end_of_text|>','') for input_text in input_texts]
|
38 |
#print(f"input_texts[0]: {input_texts[0]}")
|
39 |
inputs = model.tokenize(input_texts[0].encode('utf-8'))
|
40 |
-
for token in model
|
41 |
#print(f"token: {token}")
|
42 |
text = model.detokenize([token])
|
43 |
#print(f"text detok: {text}")
|
@@ -57,7 +57,7 @@ with gr.Blocks() as demo:
|
|
57 |
['If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home?'],
|
58 |
['Find the least odd prime factor of $2019^8+1$.'],
|
59 |
],
|
60 |
-
cache_examples=
|
61 |
fill_height=True
|
62 |
)
|
63 |
|
|
|
37 |
input_texts = [input_text.replace('<|end_of_text|>','') for input_text in input_texts]
|
38 |
#print(f"input_texts[0]: {input_texts[0]}")
|
39 |
inputs = model.tokenize(input_texts[0].encode('utf-8'))
|
40 |
+
for token in model(inputs, top_p=top_p, temp=temperature, stream=True):
|
41 |
#print(f"token: {token}")
|
42 |
text = model.detokenize([token])
|
43 |
#print(f"text detok: {text}")
|
|
|
57 |
['If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home?'],
|
58 |
['Find the least odd prime factor of $2019^8+1$.'],
|
59 |
],
|
60 |
+
cache_examples=False,
|
61 |
fill_height=True
|
62 |
)
|
63 |
|