Spaces:
Sleeping
Sleeping
Commit ·
a2cebb0
1
Parent(s): a0ee3bd
fixes
Browse files
app.py
CHANGED
|
@@ -4,15 +4,11 @@ import time
|
|
| 4 |
import json
|
| 5 |
import requests
|
| 6 |
import threading
|
| 7 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, TextIteratorStreamer
|
| 8 |
-
from peft import PeftModel
|
| 9 |
-
|
| 10 |
-
print("CUDA available:", torch.cuda.is_available())
|
| 11 |
-
if torch.cuda.is_available():
|
| 12 |
-
print(f"CUDA device count: {torch.cuda.device_count()}")
|
| 13 |
-
print(f"CUDA device: {torch.cuda.get_device_name(0)}")
|
| 14 |
-
print(f"CUDA memory: {torch.cuda.get_device_properties(0).total_memory / 1e9:.2f} GB")
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Get token from environment
|
| 17 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 18 |
print(f"HF_TOKEN is {'available' if HF_TOKEN else 'not available'}")
|
|
|
|
| 4 |
import json
|
| 5 |
import requests
|
| 6 |
import threading
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
"""
|
| 9 |
+
This app uses the Hugging Face Inference API to generate responses from the
|
| 10 |
+
Trinoid/Data_Management_Mistral model.
|
| 11 |
+
"""
|
| 12 |
# Get token from environment
|
| 13 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 14 |
print(f"HF_TOKEN is {'available' if HF_TOKEN else 'not available'}")
|