Spaces:
Runtime error
Runtime error
Commit
Β·
bed9432
1
Parent(s):
4ea9a2c
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
generator = pipeline("text-geenration",model="gpt2")
|
3 |
+
result=generator("in this AI course, the learning outcomes are",max_length=30,num_return_sequences=3)
|
4 |
+
print(result[0])
|
5 |
+
print(result[1])
|
6 |
+
print(result[2])
|
7 |
+
|
8 |
+
import gradio as gr
|
9 |
+
import time
|
10 |
+
def greet(name):
|
11 |
+
message_to_user="start here"
|
12 |
+
return "Hello " + name + "!"
|
13 |
+
|
14 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
15 |
+
|
16 |
+
demo.launch()
|