Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -13,13 +13,13 @@ GROQ_ENDPOINT = "https://api.groq.com/openai/v1/chat/completions"
|
|
| 13 |
MODEL_NAME = os.environ.get("MODEL_NAME", "llama-3.1-8b-instant")
|
| 14 |
|
| 15 |
# ----------------------------------------------------------------------
|
| 16 |
-
# CSS (passed to demo.launch)
|
| 17 |
# ----------------------------------------------------------------------
|
| 18 |
CSS = """
|
| 19 |
#chatbot .message {
|
| 20 |
font-family: Arial, Helvetica, sans-serif;
|
| 21 |
}
|
| 22 |
-
#
|
| 23 |
background-color: #1E90FF;
|
| 24 |
color: white;
|
| 25 |
border: none;
|
|
@@ -27,7 +27,7 @@ CSS = """
|
|
| 27 |
font-size: 1rem;
|
| 28 |
cursor: pointer;
|
| 29 |
}
|
| 30 |
-
#
|
| 31 |
background-color: #1C86EE;
|
| 32 |
}
|
| 33 |
"""
|
|
@@ -55,5 +55,5 @@ def call_groq(messages):
|
|
| 55 |
data = response.json()
|
| 56 |
# Extract the assistant's content
|
| 57 |
content = data["choices"][0]["message"]["content"]
|
| 58 |
-
#
|
| 59 |
if content.startswith("
|
|
|
|
| 13 |
MODEL_NAME = os.environ.get("MODEL_NAME", "llama-3.1-8b-instant")
|
| 14 |
|
| 15 |
# ----------------------------------------------------------------------
|
| 16 |
+
# CSS (will be passed to demo.launch)
|
| 17 |
# ----------------------------------------------------------------------
|
| 18 |
CSS = """
|
| 19 |
#chatbot .message {
|
| 20 |
font-family: Arial, Helvetica, sans-serif;
|
| 21 |
}
|
| 22 |
+
#submit-btn {
|
| 23 |
background-color: #1E90FF;
|
| 24 |
color: white;
|
| 25 |
border: none;
|
|
|
|
| 27 |
font-size: 1rem;
|
| 28 |
cursor: pointer;
|
| 29 |
}
|
| 30 |
+
#submit-btn:hover {
|
| 31 |
background-color: #1C86EE;
|
| 32 |
}
|
| 33 |
"""
|
|
|
|
| 55 |
data = response.json()
|
| 56 |
# Extract the assistant's content
|
| 57 |
content = data["choices"][0]["message"]["content"]
|
| 58 |
+
# Clean possible markdown code fences
|
| 59 |
if content.startswith("
|