Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -405,7 +405,20 @@ with gr.Blocks() as demo:
|
|
| 405 |
fn=run_and_submit_all,
|
| 406 |
outputs=[status_output, results_table]
|
| 407 |
)
|
|
|
|
| 408 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 409 |
if __name__ == "__main__":
|
| 410 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
| 411 |
# Check for SPACE_HOST and SPACE_ID at startup for information
|
|
|
|
| 405 |
fn=run_and_submit_all,
|
| 406 |
outputs=[status_output, results_table]
|
| 407 |
)
|
| 408 |
+
print("Testing Hugging Face Inference...")
|
| 409 |
|
| 410 |
+
from test_hf import client
|
| 411 |
+
|
| 412 |
+
try:
|
| 413 |
+
response = client.chat.completions.create(
|
| 414 |
+
model="speakleash/Bielik-11B-v3.0-Instruct:publicai",
|
| 415 |
+
messages=[{"role": "user", "content": "Say hello."}],
|
| 416 |
+
max_tokens=30
|
| 417 |
+
)
|
| 418 |
+
print("TEST SUCCESS:", response.choices[0].message.content)
|
| 419 |
+
except Exception as e:
|
| 420 |
+
print("TEST FAILED:", e)
|
| 421 |
+
|
| 422 |
if __name__ == "__main__":
|
| 423 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
| 424 |
# Check for SPACE_HOST and SPACE_ID at startup for information
|