rahul7star commited on
Commit
5b5977f
·
verified ·
1 Parent(s): c848279

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -1,7 +1,10 @@
1
  import os
2
  os.environ["HF_HOME"] = "/tmp/hf_cache"
3
  os.makedirs("/tmp/hf_cache", exist_ok=True)
4
-
 
 
 
5
  from fastapi import FastAPI, Query
6
  from huggingface_hub import list_repo_files, hf_hub_download, upload_file
7
  import io
@@ -19,8 +22,21 @@ import os
19
  import os
20
  import zipfile
21
  import tempfile # ✅ Add this!
 
 
22
 
 
 
 
 
 
 
 
 
 
 
23
 
 
24
 
25
 
26
  app = FastAPI()
@@ -430,6 +446,7 @@ def start_training(
430
  push_to_hub = False
431
 
432
  slugged_lora_name = lora_name.replace(" ", "_").lower()
 
433
 
434
  # Load base config
435
  config = {
 
1
  import os
2
  os.environ["HF_HOME"] = "/tmp/hf_cache"
3
  os.makedirs("/tmp/hf_cache", exist_ok=True)
4
+ from huggingface_hub import whoami
5
+ os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
6
+ import sys
7
+ import spaces
8
  from fastapi import FastAPI, Query
9
  from huggingface_hub import list_repo_files, hf_hub_download, upload_file
10
  import io
 
22
  import os
23
  import zipfile
24
  import tempfile # ✅ Add this!
25
+ import yaml
26
+ sys.path.insert(0, os.getcwd())
27
 
28
+ import gradio as gr
29
+ from PIL import Image
30
+ import torch
31
+ import uuid
32
+ import os
33
+ import shutil
34
+ import json
35
+ import yaml
36
+ from slugify import slugify
37
+ from transformers import AutoProcessor, AutoModelForCausalLM
38
 
39
+ sys.path.insert(0, "ai-toolkit")
40
 
41
 
42
  app = FastAPI()
 
446
  push_to_hub = False
447
 
448
  slugged_lora_name = lora_name.replace(" ", "_").lower()
449
+ print(username)
450
 
451
  # Load base config
452
  config = {