Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,16 +11,16 @@ from threading import Thread
|
|
11 |
import spaces
|
12 |
import time
|
13 |
|
14 |
-
token = os.environ["HF_TOKEN"]
|
15 |
|
16 |
quantization_config = BitsAndBytesConfig(
|
17 |
load_in_4bit=True, bnb_4bit_compute_dtype=torch.float16
|
18 |
)
|
19 |
|
20 |
model = AutoModelForCausalLM.from_pretrained(
|
21 |
-
"
|
22 |
)
|
23 |
-
tok = AutoTokenizer.from_pretrained("
|
24 |
terminators = [
|
25 |
tok.eos_token_id,
|
26 |
tok.convert_tokens_to_ids("<|eot_id|>")
|
@@ -37,7 +37,7 @@ else:
|
|
37 |
# Dispatch Errors
|
38 |
|
39 |
|
40 |
-
@spaces.GPU(duration=
|
41 |
def chat(message, history, temperature,do_sample, max_tokens):
|
42 |
chat = []
|
43 |
for item in history:
|
@@ -97,6 +97,6 @@ demo = gr.ChatInterface(
|
|
97 |
],
|
98 |
stop_btn="Stop Generation",
|
99 |
title="Chat With LLMs",
|
100 |
-
description="Now Running [
|
101 |
)
|
102 |
demo.launch()
|
|
|
11 |
import spaces
|
12 |
import time
|
13 |
|
14 |
+
#token = os.environ["HF_TOKEN"]
|
15 |
|
16 |
quantization_config = BitsAndBytesConfig(
|
17 |
load_in_4bit=True, bnb_4bit_compute_dtype=torch.float16
|
18 |
)
|
19 |
|
20 |
model = AutoModelForCausalLM.from_pretrained(
|
21 |
+
"shisa-ai/shisa-v1-qwen2-7b", quantization_config=quantization_config, token=token
|
22 |
)
|
23 |
+
tok = AutoTokenizer.from_pretrained("shisa-ai/shisa-v1-qwen2-7b", token=token)
|
24 |
terminators = [
|
25 |
tok.eos_token_id,
|
26 |
tok.convert_tokens_to_ids("<|eot_id|>")
|
|
|
37 |
# Dispatch Errors
|
38 |
|
39 |
|
40 |
+
@spaces.GPU(duration=120)
|
41 |
def chat(message, history, temperature,do_sample, max_tokens):
|
42 |
chat = []
|
43 |
for item in history:
|
|
|
97 |
],
|
98 |
stop_btn="Stop Generation",
|
99 |
title="Chat With LLMs",
|
100 |
+
description="Now Running [shisa-ai/shisa-v1-qwen2-7b](https://huggingface.co/shisa-ai/shisa-v1-qwen2-7b) in 4bit"
|
101 |
)
|
102 |
demo.launch()
|