Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import spaces
|
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
import torch
|
5 |
|
6 |
-
model_name = "rubenroy/Zurich-
|
7 |
model = AutoModelForCausalLM.from_pretrained(
|
8 |
model_name,
|
9 |
torch_dtype=torch.bfloat16,
|
@@ -14,7 +14,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
14 |
@spaces.GPU
|
15 |
def generate(message, chat_history, temperature=0.7, top_p=0.9, top_k=50, max_new_tokens=512, repetition_penalty=1.1):
|
16 |
messages = [
|
17 |
-
{"role": "system", "content": "You are Zurich, a
|
18 |
{"role": "user", "content": message}
|
19 |
]
|
20 |
text = tokenizer.apply_chat_template(
|
@@ -112,10 +112,10 @@ TITLE_HTML = """
|
|
112 |
<div style="display: flex; align-items: center; justify-content: center; gap: 1rem;">
|
113 |
<h1 style="font-size: 2.5rem; font-weight: 800; margin: 0; background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">Zurich</h1>
|
114 |
<div style="width: 2px; height: 2.5rem; background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%);"></div>
|
115 |
-
<p style="font-size: 1.25rem; color: #94a3b8; margin: 0;">GammaCorpus v2-
|
116 |
</div>
|
117 |
<div class="info-section">
|
118 |
-
<span>Fine-tuned from <a href="https://huggingface.co/Qwen/Qwen2.5-
|
119 |
</div>
|
120 |
</div>
|
121 |
|
@@ -126,12 +126,12 @@ TITLE_HTML = """
|
|
126 |
7B Models
|
127 |
</h2>
|
128 |
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;">
|
129 |
-
<a href="https://huggingface.co/
|
130 |
-
<a href="https://huggingface.co/
|
131 |
-
<a href="https://huggingface.co/
|
132 |
-
<a href="https://huggingface.co/
|
133 |
-
<a href="https://huggingface.co/
|
134 |
-
<a href="https://huggingface.co/
|
135 |
</div>
|
136 |
</div>
|
137 |
<div class="model-section">
|
@@ -140,12 +140,12 @@ TITLE_HTML = """
|
|
140 |
14B Models
|
141 |
</h2>
|
142 |
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;">
|
143 |
-
<a href="https://huggingface.co/
|
144 |
-
<a href="https://huggingface.co/
|
145 |
-
<a href="https://huggingface.co/
|
146 |
-
<a href="https://huggingface.co/
|
147 |
-
<a href="https://huggingface.co/
|
148 |
-
<a href="https://huggingface.co/
|
149 |
</div>
|
150 |
</div>
|
151 |
</div>
|
|
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
import torch
|
5 |
|
6 |
+
model_name = "rubenroy/Zurich-14B-GCv2-5m"
|
7 |
model = AutoModelForCausalLM.from_pretrained(
|
8 |
model_name,
|
9 |
torch_dtype=torch.bfloat16,
|
|
|
14 |
@spaces.GPU
|
15 |
def generate(message, chat_history, temperature=0.7, top_p=0.9, top_k=50, max_new_tokens=512, repetition_penalty=1.1):
|
16 |
messages = [
|
17 |
+
{"role": "system", "content": "You are Zurich, a 14 billion parameter Large Language model built on the Qwen 2.5 14B model developed by Alibaba Cloud, and fine-tuned by Ruben Roy. You have been fine-tuned with the GammaCorpus v2 dataset, a dataset filled with structured and filtered multi-turn conversations and was also created by Ruben Roy. You are a helpful assistant."},
|
18 |
{"role": "user", "content": message}
|
19 |
]
|
20 |
text = tokenizer.apply_chat_template(
|
|
|
112 |
<div style="display: flex; align-items: center; justify-content: center; gap: 1rem;">
|
113 |
<h1 style="font-size: 2.5rem; font-weight: 800; margin: 0; background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">Zurich</h1>
|
114 |
<div style="width: 2px; height: 2.5rem; background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%);"></div>
|
115 |
+
<p style="font-size: 1.25rem; color: #94a3b8; margin: 0;">GammaCorpus v2-5m</p>
|
116 |
</div>
|
117 |
<div class="info-section">
|
118 |
+
<span>Fine-tuned from <a href="https://huggingface.co/Qwen/Qwen2.5-14B-Instruct" class="info-link">Qwen 2.5 14B Instruct</a> | Model: <a href="https://huggingface.co/rubenroy/Zurich-14B-GCv2-5m" class="info-link">Zurich-14B-GCv2-5m</a> | Training Dataset: <a href="https://huggingface.co/datasets/rubenroy/GammaCorpus-v2-5m" class="info-link">GammaCorpus v2 5m</a></span>
|
119 |
</div>
|
120 |
</div>
|
121 |
|
|
|
126 |
7B Models
|
127 |
</h2>
|
128 |
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;">
|
129 |
+
<a href="https://huggingface.co/rubenroy/Zurich-7B-GCv2-5m" class="model-btn">Zurich 7B GCv2 5m</a>
|
130 |
+
<a href="https://huggingface.co/rubenroy/Zurich-7B-GCv2-1m" class="model-btn">Zurich 7B GCv2 1m</a>
|
131 |
+
<a href="https://huggingface.co/rubenroy/Zurich-7B-GCv2-500k" class="model-btn">Zurich 7B GCv2 500k</a>
|
132 |
+
<a href="https://huggingface.co/rubenroy/Zurich-7B-GCv2-100k" class="model-btn">Zurich 7B GCv2 100k</a>
|
133 |
+
<a href="https://huggingface.co/rubenroy/Zurich-7B-GCv2-50k" class="model-btn">Zurich 7B GCv2 50k</a>
|
134 |
+
<a href="https://huggingface.co/sces/rubenroy/Zurich-7B-GCv2-10k" class="model-btn">Zurich 7B GCv2 10k</a>
|
135 |
</div>
|
136 |
</div>
|
137 |
<div class="model-section">
|
|
|
140 |
14B Models
|
141 |
</h2>
|
142 |
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;">
|
143 |
+
<a href="https://huggingface.co/rubenroy/Zurich-14B-GCv2-5m" class="model-btn">Zurich 14B GCv2 5m</a>
|
144 |
+
<a href="https://huggingface.co/rubenroy/Zurich-14B-GCv2-1m" class="model-btn">Zurich 14B GCv2 1m</a>
|
145 |
+
<a href="https://huggingface.co/rubenroy/Zurich-14B-GCv2-500k" class="model-btn">Zurich 14B GCv2 500k</a>
|
146 |
+
<a href="https://huggingface.co/rubenroy/Zurich-14B-GCv2-100k" class="model-btn">Zurich 14B GCv2 100k</a>
|
147 |
+
<a href="https://huggingface.co/rubenroy/Zurich-14B-GCv2-50k" class="model-btn">Zurich 14B GCv2 50k</a>
|
148 |
+
<a href="https://huggingface.co/rubenroy/Zurich-14B-GCv2-10k" class="model-btn">Zurich 14B GCv2 10k</a>
|
149 |
</div>
|
150 |
</div>
|
151 |
</div>
|