Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,20 @@ from huggingface_hub import InferenceClient
|
|
| 4 |
"""
|
| 5 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 6 |
"""
|
| 7 |
-
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
def respond(
|
|
|
|
| 4 |
"""
|
| 5 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 6 |
"""
|
| 7 |
+
# client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 8 |
+
|
| 9 |
+
MODEL_URL = "https://huggingface.co/datasets/psy7743/llama3-8b-instruct-Q8_0.gguf/blob/main/llama3-8b-instruct-Q8_0.gguf"
|
| 10 |
+
MODEL_PATH = "llama3-8b-instruct-Q8_0.gguf"
|
| 11 |
+
|
| 12 |
+
if not Path(MODEL_PATH).exists():
|
| 13 |
+
print("📥 Downloading LLaMA model from Hugging Face Datasets...")
|
| 14 |
+
response = requests.get(MODEL_URL, stream=True)
|
| 15 |
+
with open(MODEL_PATH, "wb") as f:
|
| 16 |
+
for chunk in response.iter_content(chunk_size=8192):
|
| 17 |
+
if chunk:
|
| 18 |
+
f.write(chunk)
|
| 19 |
+
print("✅ Download complete!")
|
| 20 |
+
|
| 21 |
|
| 22 |
|
| 23 |
def respond(
|