Eitan Lifshits
commited on
Commit
•
bb76e7b
1
Parent(s):
9f8e44a
Update def to use summarizer
Browse files- .gitignore +2 -0
- app.py +16 -4
- requirements.txt +2 -0
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
venv/
|
2 |
+
venv
|
app.py
CHANGED
@@ -1,7 +1,19 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
def greet(name):
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
|
|
|
|
|
4 |
|
5 |
+
summarizer = pipeline('summarization', model='Eitanli/resume_label_summary_model')
|
6 |
+
|
7 |
+
|
8 |
+
def predict(text):
|
9 |
+
summary = summarizer(text, max_length=10, min_length=2)
|
10 |
+
return {'summary': summary}
|
11 |
+
|
12 |
+
|
13 |
+
iface = gr.Interface(
|
14 |
+
fn=predict,
|
15 |
+
inputs='text',
|
16 |
+
outputs="text")
|
17 |
+
|
18 |
+
if __name__ == "__main__":
|
19 |
+
iface.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
transformers==4.30.2
|
2 |
+
torch>=2.0
|