Bofandra commited on
Commit
4bead39
Β·
verified Β·
1 Parent(s): 21c079d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -4,11 +4,31 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
4
  import torch
5
  import time
6
  from datetime import datetime
 
7
 
8
  import os
 
9
 
10
- print("Current Directory:", os.getcwd())
11
- print("Files in directory:", os.listdir("."))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  torch.random.manual_seed(0)
14
  """
 
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
+
27
+ if os.path.exists(model_path):
28
+ print(f"βœ… Model found at: {model_path}")
29
+ else:
30
+ print(f"❌ Model not found at: {model_path}")
31
+ print("πŸ” Available files:", os.listdir("./models"))
32
 
33
  torch.random.manual_seed(0)
34
  """