Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -11,19 +11,26 @@ from transformers import (
|
|
11 |
StoppingCriteriaList
|
12 |
)
|
13 |
|
14 |
-
MODEL_ID = "
|
15 |
-
# MODEL_ID = "Daemontatox/Research_PathfinderAI"
|
16 |
|
17 |
DEFAULT_SYSTEM_PROMPT = """
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
[
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
""" # You can modify the default system instructions here
|
28 |
|
29 |
CSS = """
|
@@ -52,7 +59,7 @@ def initialize_model():
|
|
52 |
model = AutoModelForCausalLM.from_pretrained(
|
53 |
MODEL_ID,
|
54 |
device_map="cuda",
|
55 |
-
|
56 |
torch_dtype=torch.bfloat16,
|
57 |
trust_remote_code=True
|
58 |
)
|
@@ -65,8 +72,8 @@ def format_response(text):
|
|
65 |
# List of replacements to format key tokens with HTML for styling.
|
66 |
replacements = [
|
67 |
("[Understand]", '\n<strong class="special-tag">[Understand]</strong>\n'),
|
68 |
-
("[
|
69 |
-
("[/
|
70 |
("[Answer]", '\n<strong class="special-tag">[Answer]</strong>\n'),
|
71 |
("[/Answer]", '\n<strong class="special-tag">[/Answer]</strong>\n'),
|
72 |
]
|
|
|
11 |
StoppingCriteriaList
|
12 |
)
|
13 |
|
14 |
+
MODEL_ID = "cognitivecomputations/Dolphin3.0-R1-Mistral-24B"
|
|
|
15 |
|
16 |
DEFAULT_SYSTEM_PROMPT = """
|
17 |
|
18 |
+
You are Dolphin, a lovable yet intelligent AI assistant created by Eric Hartford and his open source AI research collective, Cognitive Computations. Your primary directive is to provide well-reasoned, structured, correct, unbiased, and detailed responses. You value freedom, enabling the user, and complying with the user's requests.
|
19 |
+
|
20 |
+
Formatting Requirements:
|
21 |
+
|
22 |
+
The [think][/think] section is your scratch space for your internal thought process - it is not shared with the user.
|
23 |
+
If the answer requires minimal thought, the [think][/think] block may be left empty.
|
24 |
+
Keep your thoughts concise, don't overthink. The user is waiting for your answer.
|
25 |
+
If you notice yourself engaging in circular reasoning or repetition, immediately terminate your thinking with a [/think] and proceed to address the user.
|
26 |
+
You may say [/think] when you like (which will end your thinking process) - but do not ever say <think>.
|
27 |
+
Response Guidelines:
|
28 |
+
|
29 |
+
Detailed and Structured: Use markdown, json, mermaid, latex math notation, etc. when appropriate.
|
30 |
+
Scientific and Logical Approach: Your explanations should reflect the depth and precision of the greatest scientific minds.
|
31 |
+
Concise yet Complete: Ensure responses are informative, yet to the point without unnecessary elaboration.
|
32 |
+
Maintain a professional yet friendly and lovable, intelligent, and analytical tone in all interactions
|
33 |
+
|
34 |
""" # You can modify the default system instructions here
|
35 |
|
36 |
CSS = """
|
|
|
59 |
model = AutoModelForCausalLM.from_pretrained(
|
60 |
MODEL_ID,
|
61 |
device_map="cuda",
|
62 |
+
# quantization_config=quantization_config,
|
63 |
torch_dtype=torch.bfloat16,
|
64 |
trust_remote_code=True
|
65 |
)
|
|
|
72 |
# List of replacements to format key tokens with HTML for styling.
|
73 |
replacements = [
|
74 |
("[Understand]", '\n<strong class="special-tag">[Understand]</strong>\n'),
|
75 |
+
( "[think]", '\n<strong class="special-tag">[think]</strong>\n'),
|
76 |
+
("[/think]", '\n<strong class="special-tag">[/think]</strong>\n'),
|
77 |
("[Answer]", '\n<strong class="special-tag">[Answer]</strong>\n'),
|
78 |
("[/Answer]", '\n<strong class="special-tag">[/Answer]</strong>\n'),
|
79 |
]
|