Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -15,14 +15,14 @@ subprocess.run(["playwright", "install"])
|
|
15 |
|
16 |
# Load environment variables
|
17 |
load_dotenv()
|
18 |
-
HUGGINGFACEHUB_API_TOKEN = os.getenv('
|
19 |
|
20 |
# Initialize the model instances
|
21 |
#repo_id = "mistralai/Mistral-7B-Instruct-v0.2"
|
22 |
repo_id = "Qwen/Qwen2.5-72B-Instruct"
|
23 |
|
24 |
llm_model_instance = HuggingFaceEndpoint(
|
25 |
-
repo_id=repo_id,
|
26 |
)
|
27 |
|
28 |
embedder_model_instance = HuggingFaceInferenceAPIEmbeddings(
|
@@ -32,9 +32,8 @@ embedder_model_instance = HuggingFaceInferenceAPIEmbeddings(
|
|
32 |
graph_config = {
|
33 |
"llm": {
|
34 |
"model_instance": llm_model_instance,
|
35 |
-
"model_tokens": 10000,
|
36 |
},
|
37 |
-
|
38 |
}
|
39 |
#######
|
40 |
def clean_json_string(json_str):
|
|
|
15 |
|
16 |
# Load environment variables
|
17 |
load_dotenv()
|
18 |
+
HUGGINGFACEHUB_API_TOKEN = os.getenv('API_TOKEN')
|
19 |
|
20 |
# Initialize the model instances
|
21 |
#repo_id = "mistralai/Mistral-7B-Instruct-v0.2"
|
22 |
repo_id = "Qwen/Qwen2.5-72B-Instruct"
|
23 |
|
24 |
llm_model_instance = HuggingFaceEndpoint(
|
25 |
+
repo_id=repo_id, temperature=0.5, token=HUGGINGFACEHUB_API_TOKEN
|
26 |
)
|
27 |
|
28 |
embedder_model_instance = HuggingFaceInferenceAPIEmbeddings(
|
|
|
32 |
graph_config = {
|
33 |
"llm": {
|
34 |
"model_instance": llm_model_instance,
|
|
|
35 |
},
|
36 |
+
"embeddings": {"model_instance": embedder_model_instance}
|
37 |
}
|
38 |
#######
|
39 |
def clean_json_string(json_str):
|