Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -68,30 +68,35 @@ def inference(text, input):
|
|
68 |
return output
|
69 |
|
70 |
def choose_model(name):
|
71 |
-
|
72 |
return load_model(name), load_tokenizer(name)
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
return output
|
69 |
|
70 |
def choose_model(name):
|
|
|
71 |
return load_model(name), load_tokenizer(name)
|
72 |
|
73 |
+
demo = gr.Blocks()
|
74 |
+
|
75 |
+
with demo:
|
76 |
+
|
77 |
+
|
78 |
+
name = gr.inputs.Dropdown(["s3nh/pythia-1.4b-deduped-16k-steps-self-instruct-polish", "s3nh/pythia-410m-91k-steps-self-instruct-polish"], "value", label= "output")
|
79 |
+
model = load_model(name)
|
80 |
+
tokenizer = load_tokenizer(name)
|
81 |
+
|
82 |
+
io = gr.Interface(
|
83 |
+
inference,
|
84 |
+
inputs = [gr.Textbox(
|
85 |
+
lines = 3,
|
86 |
+
max_lines = 10,
|
87 |
+
placeholder = "Add question here",
|
88 |
+
interactive = True,
|
89 |
+
show_label = False
|
90 |
+
),
|
91 |
+
gr.Textbox(
|
92 |
+
lines = 3,
|
93 |
+
max_lines = 10,
|
94 |
+
placeholder = "Add context here",
|
95 |
+
interactive = True,
|
96 |
+
show_label = False
|
97 |
+
)],
|
98 |
+
outputs = [gr.Textbox(lines = 1, label = 'Pythia410m', interactive = False)],
|
99 |
+
cache_examples = False,
|
100 |
+
)
|
101 |
+
|
102 |
+
demo.launch()
|