Spaces:
Build error
Build error
modified imple
Browse files
app.py
CHANGED
@@ -14,8 +14,21 @@ examples = [
|
|
14 |
["2040년 미국은, "]
|
15 |
]
|
16 |
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
|
21 |
|
|
|
14 |
["2040년 미국은, "]
|
15 |
]
|
16 |
|
17 |
+
pipe = pipeline('text-generation', model=model_name, use_auth_token=os.environ['TOKEN'])
|
18 |
+
|
19 |
+
def predict(text):
|
20 |
+
return pipe(text, do_sample=True, return_full_text=False, max_length=100)[0]['generated_text']
|
21 |
+
|
22 |
+
iface = gr.Interface(
|
23 |
+
fn=predict,
|
24 |
+
inputs='text',
|
25 |
+
outputs='text',
|
26 |
+
examples=examples
|
27 |
+
)
|
28 |
+
|
29 |
+
iface.launch()
|
30 |
+
|
31 |
+
|
32 |
|
33 |
|
34 |
|