Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,33 @@ Original file is located at
|
|
9 |
|
10 |
import gradio as gr
|
11 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
model_name = "microsoft/DialoGPT-small"
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
9 |
|
10 |
import gradio as gr
|
11 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
12 |
+
print("Starting app.py")
|
13 |
+
|
14 |
+
import gradio as gr
|
15 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
16 |
+
|
17 |
+
print("Imports successful")
|
18 |
+
|
19 |
+
model_name = "microsoft/DialoGPT-small"
|
20 |
+
print(f"Loading model {model_name}...")
|
21 |
+
|
22 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
23 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
24 |
+
model.eval()
|
25 |
+
|
26 |
+
print("Model loaded successfully")
|
27 |
+
|
28 |
+
# your rest of the code...
|
29 |
+
|
30 |
+
with gr.Blocks() as demo:
|
31 |
+
# ... UI components ...
|
32 |
+
|
33 |
+
demo.launch()
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
|
40 |
model_name = "microsoft/DialoGPT-small"
|
41 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|