Spaces:
Runtime error
Runtime error
Mr-Vicky-01
commited on
Commit
•
8384fe4
1
Parent(s):
d06e5ff
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,16 @@
|
|
1 |
-
from
|
2 |
import gradio as gr
|
3 |
|
4 |
checkpoint = "Mr-Vicky-01/Bart-Finetuned-conversational-summarization"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
8 |
|
9 |
def generate_summary(text):
|
10 |
-
|
11 |
-
summary_ids = model.generate(inputs['input_ids'], max_new_tokens=100, do_sample=False)
|
12 |
-
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
13 |
return summary
|
14 |
|
15 |
examples = [
|
|
|
1 |
+
from langchain import HuggingFaceHub
|
2 |
import gradio as gr
|
3 |
|
4 |
checkpoint = "Mr-Vicky-01/Bart-Finetuned-conversational-summarization"
|
5 |
|
6 |
+
model = HuggingFaceHub(repo_id=checkpoint,
|
7 |
+
model_kwargs={"temperature":0.1,
|
8 |
+
"max_new_tokens":100,
|
9 |
+
"do_sample":False
|
10 |
+
})
|
11 |
|
12 |
def generate_summary(text):
|
13 |
+
summary = model(text)
|
|
|
|
|
14 |
return summary
|
15 |
|
16 |
examples = [
|