Spaces:
Runtime error
Runtime error
Abid
commited on
Commit
·
4783a57
1
Parent(s):
ca5cfe4
new version of gradio added from Github
Browse files
app.py
CHANGED
@@ -1,6 +1,9 @@
|
|
|
|
1 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
2 |
import torch
|
3 |
|
|
|
|
|
4 |
tokenizer = AutoTokenizer.from_pretrained("ericzhou/DialoGPT-Medium-Rick_v2")
|
5 |
model = AutoModelForCausalLM.from_pretrained("ericzhou/DialoGPT-Medium-Rick_v2")
|
6 |
|
@@ -42,11 +45,11 @@ with demo:
|
|
42 |
</center>
|
43 |
"""
|
44 |
)
|
45 |
-
state = gr.Variable(
|
46 |
chatbot = gr.Chatbot()
|
47 |
text = gr.Textbox(
|
48 |
label="Talk to Morty here... (press enter to submit)",
|
49 |
-
|
50 |
max_lines=1,
|
51 |
)
|
52 |
|
|
|
1 |
+
import subprocess
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
+
subprocess.run(["pip", "install", "-U", "https://github.com/gradio-app/gradio"])
|
6 |
+
|
7 |
tokenizer = AutoTokenizer.from_pretrained("ericzhou/DialoGPT-Medium-Rick_v2")
|
8 |
model = AutoModelForCausalLM.from_pretrained("ericzhou/DialoGPT-Medium-Rick_v2")
|
9 |
|
|
|
45 |
</center>
|
46 |
"""
|
47 |
)
|
48 |
+
state = gr.Variable(default_value=[])
|
49 |
chatbot = gr.Chatbot()
|
50 |
text = gr.Textbox(
|
51 |
label="Talk to Morty here... (press enter to submit)",
|
52 |
+
default_value="How are you?",
|
53 |
max_lines=1,
|
54 |
)
|
55 |
|