Spaces:
Paused
Paused
Commit
·
797cdd1
1
Parent(s):
e8ae0c0
Create app_v1.py
Browse files
app_v1.py
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
################## DISCOVERING PHASE #############################
|
2 |
+
import streamlit as st
|
3 |
+
from transformers import AutoTokenizer, pipeline, logging
|
4 |
+
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
5 |
+
from huggingface_hub import snapshot_download
|
6 |
+
|
7 |
+
#import shutil
|
8 |
+
import os
|
9 |
+
|
10 |
+
cwd = os.getcwd()
|
11 |
+
cachedir = cwd+'/cache'
|
12 |
+
|
13 |
+
# Check if the directory exists before creating it
|
14 |
+
if not os.path.exists(cachedir):
|
15 |
+
os.mkdir(cachedir)
|
16 |
+
|
17 |
+
os.environ['HF_HOME'] = cachedir
|
18 |
+
|
19 |
+
local_folder = cachedir + "/model"
|
20 |
+
|
21 |
+
|
22 |
+
quantized_model_dir = "FPHam/Jackson_The_Formalizer_V2_13b_GPTQ"
|
23 |
+
|
24 |
+
snapshot_download(repo_id=quantized_model_dir, local_dir=local_folder, local_dir_use_symlinks=True)
|
25 |
+
|
26 |
+
model_basename = cachedir + "/model/Jackson2-4bit-128g-GPTQ"
|
27 |
+
|
28 |
+
use_strict = False
|
29 |
+
|
30 |
+
use_triton = False
|