basilkr commited on
Commit
0d11999
·
verified ·
1 Parent(s): 0721ac7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -3
app.py CHANGED
@@ -1,7 +1,18 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
5
 
6
- iface = gr.Interface("basilkr/luke_ST_low", inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
7
  iface.launch()
 
1
  import gradio as gr
2
+ import torch
3
 
4
+ # Load the model
5
+ model = torch.load("path/to/basilkr_luke_ST_low_model.pth")
6
+ model.eval() # Set the model to evaluation mode
7
 
8
+ # Define a function to make predictions
9
+ def predict(text):
10
+ # Perform inference using the model
11
+ # You need to adapt this based on the specific requirements of your model
12
+ result = model(text)
13
+
14
+ return result
15
+
16
+ # Create the Gradio interface
17
+ iface = gr.Interface(fn=predict, inputs="text", outputs="text")
18
  iface.launch()