Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#Gradio App
|
| 2 |
+
def predict(input_text):
|
| 3 |
+
inputs = tokenizer.encode(input_text, return_tensors="pt")
|
| 4 |
+
outputs = model.generate(inputs, max_length=100)
|
| 5 |
+
return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
import gradio as gr
|
| 9 |
+
|
| 10 |
+
iface = gr.Interface(fn=predict,
|
| 11 |
+
inputs="text",
|
| 12 |
+
outputs="text",
|
| 13 |
+
title="Fine-Tuned Language Model",
|
| 14 |
+
description="Type something to interact with the fine-tuned model.")
|
| 15 |
+
iface.launch()
|