Marko-suchy commited on
Commit
af4bc7d
·
verified ·
1 Parent(s): 8c549ab

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
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()