Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import re
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# ✅ Load Hugging Face summarization/chat model
|
6 |
summarizer = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.1")
|
7 |
|
8 |
-
|
9 |
# ✅ Highlight matching and find missing keywords
|
10 |
from sklearn.feature_extraction.text import ENGLISH_STOP_WORDS
|
11 |
|
@@ -94,4 +98,4 @@ def create_ui():
|
|
94 |
return demo
|
95 |
|
96 |
if __name__ == '__main__':
|
97 |
-
create_ui().launch()
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import re
|
4 |
+
import os
|
5 |
+
from huggingface_hub import login
|
6 |
+
|
7 |
+
# ✅ Authenticate using HF token stored in secret
|
8 |
+
login(token=os.environ.get("HUGGINGFACEHUB_API_TOKEN"))
|
9 |
|
10 |
# ✅ Load Hugging Face summarization/chat model
|
11 |
summarizer = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.1")
|
12 |
|
|
|
13 |
# ✅ Highlight matching and find missing keywords
|
14 |
from sklearn.feature_extraction.text import ENGLISH_STOP_WORDS
|
15 |
|
|
|
98 |
return demo
|
99 |
|
100 |
if __name__ == '__main__':
|
101 |
+
create_ui().launch()
|