Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,18 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|