SaintJagh commited on
Commit
a91f00e
·
1 Parent(s): 452e0b5

Add model and app files

Browse files
Files changed (2) hide show
  1. app.py +21 -0
  2. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import torch
3
+ from transformers import pipeline
4
+
5
+ # بارگذاری مدل
6
+ model = pipeline("text-classification", model="rinrikatoki/dorna-merged-diabetes")
7
+
8
+ def predict(text):
9
+ result = model(text)
10
+ return result
11
+
12
+ # ساخت اینترفیس Gradio
13
+ iface = gr.Interface(
14
+ fn=predict,
15
+ inputs="text",
16
+ outputs="label",
17
+ title="Diabetes Prediction Model",
18
+ description="A demo for diabetes classification model."
19
+ )
20
+
21
+ iface.launch()
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ transformers
2
+ torch
3
+ gradio