Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,23 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
|
| 4 |
import torch
|
| 5 |
import time
|
| 6 |
from datetime import datetime
|
|
|
|
|
|
|
| 7 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
model_path = "./models/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf" # Adjust if necessary
|
| 10 |
|
|
|
|
| 4 |
import torch
|
| 5 |
import time
|
| 6 |
from datetime import datetime
|
| 7 |
+
import shutil
|
| 8 |
+
|
| 9 |
import os
|
| 10 |
+
folder_path = "./models" # Change the folder name if needed
|
| 11 |
+
|
| 12 |
+
if not os.path.exists(folder_path):
|
| 13 |
+
os.makedirs(folder_path)
|
| 14 |
+
print(f"✅ Folder created: {folder_path}")
|
| 15 |
+
else:
|
| 16 |
+
print(f"📂 Folder already exists: {folder_path}")
|
| 17 |
+
|
| 18 |
+
# Define source file and destination folder
|
| 19 |
+
source_file = "tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf"
|
| 20 |
+
destination_folder = "./models"
|
| 21 |
+
|
| 22 |
+
# Copy the file
|
| 23 |
+
shutil.copy(source_file, destination_folder)
|
| 24 |
|
| 25 |
model_path = "./models/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf" # Adjust if necessary
|
| 26 |
|