Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from huggingface_hub import InferenceClient
|
|
6 |
import re
|
7 |
from datetime import datetime
|
8 |
import json
|
9 |
-
|
10 |
import arxiv
|
11 |
from utils import get_md_text_abstract, search_cleaner, get_arxiv_live_search
|
12 |
|
@@ -14,6 +14,8 @@ retrieve_results = 10
|
|
14 |
show_examples = False
|
15 |
llm_models_to_choose = ['mistralai/Mixtral-8x7B-Instruct-v0.1','mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None']
|
16 |
|
|
|
|
|
17 |
generate_kwargs = dict(
|
18 |
temperature = None,
|
19 |
max_new_tokens = 512,
|
@@ -162,7 +164,7 @@ with gr.Blocks(theme = gr.themes.Soft()) as demo:
|
|
162 |
else:
|
163 |
return model_disabled_text
|
164 |
|
165 |
-
client = InferenceClient(llm_model_picked)
|
166 |
try:
|
167 |
stream = client.text_generation(prompt, **generate_kwargs, stream=stream_outputs, details=False, return_full_text=False)
|
168 |
|
|
|
6 |
import re
|
7 |
from datetime import datetime
|
8 |
import json
|
9 |
+
import os
|
10 |
import arxiv
|
11 |
from utils import get_md_text_abstract, search_cleaner, get_arxiv_live_search
|
12 |
|
|
|
14 |
show_examples = False
|
15 |
llm_models_to_choose = ['mistralai/Mixtral-8x7B-Instruct-v0.1','mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None']
|
16 |
|
17 |
+
token = os.get_env("HF_TOKEN")
|
18 |
+
|
19 |
generate_kwargs = dict(
|
20 |
temperature = None,
|
21 |
max_new_tokens = 512,
|
|
|
164 |
else:
|
165 |
return model_disabled_text
|
166 |
|
167 |
+
client = InferenceClient(llm_model_picked, token = token)
|
168 |
try:
|
169 |
stream = client.text_generation(prompt, **generate_kwargs, stream=stream_outputs, details=False, return_full_text=False)
|
170 |
|