Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def generate(prompt, chat_history):
|
|
26 |
final_prompt += "User: " + prompt + "\n"
|
27 |
final_prompt += "Output:"
|
28 |
|
29 |
-
generated_text = phi2(final_prompt, max_new_tokens=
|
30 |
response = generated_text.split("Output:")[1].split("User:")[0]
|
31 |
|
32 |
if "Assistant:" in response:
|
@@ -41,7 +41,7 @@ with gr.Blocks() as demo:
|
|
41 |
gr.Markdown("""
|
42 |
# Phi-2 Chatbot Demo
|
43 |
|
44 |
-
This chatbot was created using Microsoft's [phi-2](https://huggingface.co/microsoft/phi-2) model.
|
45 |
""")
|
46 |
|
47 |
chatbot = gr.Chatbot()
|
|
|
26 |
final_prompt += "User: " + prompt + "\n"
|
27 |
final_prompt += "Output:"
|
28 |
|
29 |
+
generated_text = phi2(final_prompt, max_new_tokens=24)[0]["generated_text"]
|
30 |
response = generated_text.split("Output:")[1].split("User:")[0]
|
31 |
|
32 |
if "Assistant:" in response:
|
|
|
41 |
gr.Markdown("""
|
42 |
# Phi-2 Chatbot Demo
|
43 |
|
44 |
+
This chatbot was created using Microsoft's 2.7 billion parameter [phi-2](https://huggingface.co/microsoft/phi-2) Transformer model. In order to reduce the response time on this hardware, `max_new_tokens` has been set to `24` in the text generation pipeline. It takes up to 150 seconds for each response to be generated.
|
45 |
""")
|
46 |
|
47 |
chatbot = gr.Chatbot()
|