Spaces:
Build error
Build error
Commit
·
134ba5b
1
Parent(s):
f5b674b
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
-
|
|
|
|
|
|
|
4 |
def summarymaker(instruction = "", tweets = ""):
|
5 |
ARTICLE = f"""[INST] {instruction} [/INST] \\n [TWEETS] {tweets} [/TWEETS]"""
|
6 |
print(ARTICLE)
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
+
hgsec = os.getenv("HF_token")
|
4 |
+
from huggingface_hub import login
|
5 |
+
login(token = hgsec)
|
6 |
+
summarizer = pipeline("summarization", model="Sidharthkr/InstructTweetSummarizer", use_auth_token = hgsec)#, trust_remote_code=True)
|
7 |
def summarymaker(instruction = "", tweets = ""):
|
8 |
ARTICLE = f"""[INST] {instruction} [/INST] \\n [TWEETS] {tweets} [/TWEETS]"""
|
9 |
print(ARTICLE)
|