Upload folder using huggingface_hub
Browse files- ChatWorld/models.py +2 -2
- app.py +0 -2
- run_gradio.sh +0 -1
ChatWorld/models.py
CHANGED
@@ -33,12 +33,12 @@ class qwen_model:
|
|
33 |
|
34 |
class GLM():
|
35 |
def __init__(self, model_name="silk-road/Haruhi-Zero-GLM3-6B-0_4"):
|
36 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
37 |
model_name, trust_remote_code=True)
|
38 |
client = AutoModelForCausalLM.from_pretrained(
|
39 |
model_name, trust_remote_code=True, device_map="auto")
|
40 |
|
41 |
-
client = client.eval()
|
42 |
|
43 |
def message2query(messages) -> str:
|
44 |
# [{'role': 'user', 'content': 'θεΈ: εε¦θ―·θͺζδ»η»δΈδΈ'}]
|
|
|
33 |
|
34 |
class GLM():
|
35 |
def __init__(self, model_name="silk-road/Haruhi-Zero-GLM3-6B-0_4"):
|
36 |
+
self.tokenizer = AutoTokenizer.from_pretrained(
|
37 |
model_name, trust_remote_code=True)
|
38 |
client = AutoModelForCausalLM.from_pretrained(
|
39 |
model_name, trust_remote_code=True, device_map="auto")
|
40 |
|
41 |
+
self.client = client.eval()
|
42 |
|
43 |
def message2query(messages) -> str:
|
44 |
# [{'role': 'user', 'content': 'θεΈ: εε¦θ―·θͺζδ»η»δΈδΈ'}]
|
app.py
CHANGED
@@ -9,8 +9,6 @@ logging.basicConfig(level=logging.INFO, filename="demo.log", filemode="w",
|
|
9 |
format="%(asctime)s - %(name)s - %(levelname)-9s - %(filename)-8s : %(lineno)s line - %(message)s",
|
10 |
datefmt="%Y-%m-%d %H:%M:%S")
|
11 |
|
12 |
-
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"
|
13 |
-
|
14 |
chatWorld = ChatWorld()
|
15 |
|
16 |
|
|
|
9 |
format="%(asctime)s - %(name)s - %(levelname)-9s - %(filename)-8s : %(lineno)s line - %(message)s",
|
10 |
datefmt="%Y-%m-%d %H:%M:%S")
|
11 |
|
|
|
|
|
12 |
chatWorld = ChatWorld()
|
13 |
|
14 |
|
run_gradio.sh
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
export CUDA_VISIBLE_DEVICES=0
|
2 |
export HF_HOME="/workspace/jyh/.cache/huggingface"
|
3 |
-
export HF_ENDPOINT="https://hf-mirror.com"
|
4 |
|
5 |
# Start the gradio server
|
6 |
/workspace/jyh/miniconda3/envs/ChatWorld/bin/python /workspace/jyh/Zero-Haruhi/app.py
|
|
|
1 |
export CUDA_VISIBLE_DEVICES=0
|
2 |
export HF_HOME="/workspace/jyh/.cache/huggingface"
|
|
|
3 |
|
4 |
# Start the gradio server
|
5 |
/workspace/jyh/miniconda3/envs/ChatWorld/bin/python /workspace/jyh/Zero-Haruhi/app.py
|