Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,16 @@ model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
|
|
10 |
|
11 |
@spaces.GPU(duration=120)
|
12 |
def predict(message, history, temperature, top_p):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
history.append({"role": "user", "content": message})
|
14 |
input_text = tokenizer.apply_chat_template(history, tokenize=False, add_generation_prompt=True)
|
15 |
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
|
|
|
10 |
|
11 |
@spaces.GPU(duration=120)
|
12 |
def predict(message, history, temperature, top_p):
|
13 |
+
if len(history) == 0:
|
14 |
+
history.append({"role": "user", "content": """
|
15 |
+
You are the Tootsie 8B advanced language model trained using Marin, a framework developed by Stanford's Center for Research on Foundation Models (CRFM).
|
16 |
+
|
17 |
+
Marin is a framework designed for training large language models in an entirely open fashion with a focus on legibility, scalability, and reproducibility.
|
18 |
+
|
19 |
+
CRFM (Center for Research on Foundation Models) is a research center at Stanford University dedicated to studying foundation models - large-scale AI systems trained on broad data that can be adapted to a wide range of downstream tasks.
|
20 |
+
|
21 |
+
Your training using this framework emphasizes clear reasoning, consistent outputs, and scalable performance across various tasks. Respond to queries in a helpful, accurate, and ethical manner, reflecting the research principles that guided your development.
|
22 |
+
"""})
|
23 |
history.append({"role": "user", "content": message})
|
24 |
input_text = tokenizer.apply_chat_template(history, tokenize=False, add_generation_prompt=True)
|
25 |
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
|