Spaces:
Runtime error
Runtime error
Karthi
commited on
Commit
•
e13365d
1
Parent(s):
d8c8cc2
first commit
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
generator = pipeline("text-generation", model="karthibeit/my-chatgpt-model")
|
5 |
+
|
6 |
+
def generate_response(input_text):
|
7 |
+
response = generator(input_text, max_length=50)
|
8 |
+
return response[0]['generated_text']
|
9 |
+
|
10 |
+
interface = gr.Interface(fn=generate_response, inputs="text", outputs="text")
|
11 |
+
interface.launch()
|