Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
|
|
14 |
|
15 |
# Initialize the HuggingFace LLM
|
16 |
llm = HuggingFaceEndpoint(
|
17 |
-
endpoint_url="https://api-inference.huggingface.co/models/
|
18 |
model_kwargs={"api_key": os.getenv('HUGGINGFACEHUB_API_TOKEN')}
|
19 |
)
|
20 |
|
@@ -121,6 +121,8 @@ def query_text(text):
|
|
121 |
|
122 |
# Query the LLM
|
123 |
response = llm(prompt)
|
|
|
|
|
124 |
return response
|
125 |
except Exception as e:
|
126 |
print(f"Error querying text: {e}")
|
|
|
14 |
|
15 |
# Initialize the HuggingFace LLM
|
16 |
llm = HuggingFaceEndpoint(
|
17 |
+
endpoint_url="https://api-inference.huggingface.co/models/gpt-3.5-turbo", # Use a known model
|
18 |
model_kwargs={"api_key": os.getenv('HUGGINGFACEHUB_API_TOKEN')}
|
19 |
)
|
20 |
|
|
|
121 |
|
122 |
# Query the LLM
|
123 |
response = llm(prompt)
|
124 |
+
print(f"Prompt: {prompt}")
|
125 |
+
print(f"Response: {response}")
|
126 |
return response
|
127 |
except Exception as e:
|
128 |
print(f"Error querying text: {e}")
|