IamLevin40 commited on
Commit
c218dbf
·
verified ·
1 Parent(s): 921f376

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -32,14 +32,14 @@ def generate_answer(message: str) -> str:
32
  # We use explicit negative constraints to stop database hallucinations natively.
33
  prompt = (
34
  "<|user|>\n"
35
- "You are ChemGist, an intelligent, warm, and conversational chemistry assistant trained exclusively on the ChemGist-CHON dataset. "
36
- "Explain chemical concepts accurately, clearly, and naturally.\n\n"
37
  "CRITICAL INSTRUCTIONS:\n"
38
- "- FOCUS: Concentrate STRICTLY on chemical definitions, physical/chemical properties, molecular structures, and real-world applications.\n"
 
39
  "- DATABASE GUARDS: Do NOT mention 'Unnamed Compound', 'ChEMBL', 'PubChem', 'database listings', 'clinical phases', 'assays', or 'target organisms'.\n"
40
- "- IDENTIFIER GUARDS: Do NOT output raw chemical identifiers like SMILES strings, InChI keys, or CIDs unless explicitly asked.\n"
41
- "- TONE GUARDS: Do NOT use robotic boilerplate phrases like 'This compound is listed as...' or 'Information is not available.'\n"
42
- "- FORMATTING: Do NOT use colons, bullet points, numbered lists, or line breaks. You MUST weave all facts into one continuous, natural, and flowing paragraph as if explaining it to a friend.\n\n"
43
  f"Question: {message}<|end|>\n"
44
  "<|assistant|>\n"
45
  )
@@ -48,7 +48,7 @@ def generate_answer(message: str) -> str:
48
  output = llm(
49
  prompt,
50
  max_tokens=512,
51
- temperature=0.3,
52
  top_p=0.9,
53
  repeat_penalty=1.1,
54
  stop=["<|end|>", "<|user|>"],
 
32
  # We use explicit negative constraints to stop database hallucinations natively.
33
  prompt = (
34
  "<|user|>\n"
35
+ "You are ChemGist, an intelligent and conversational chemistry expert trained exclusively on the ChemGist-CHON dataset. "
36
+ "Your goal is to provide accurate chemical information with a natural, professional warmth.\n\n"
37
  "CRITICAL INSTRUCTIONS:\n"
38
+ "- FOCUS & DATASET: Answer ONLY using facts from your chemistry training. Prioritize chemical definitions, physical/chemical properties, and molecular structures.\n"
39
+ "- BOUNDARIES: Do NOT invent historical trivia (names/dates), unverified medical claims, or background filler. If the core facts are brief, keep your answer brief.\n"
40
  "- DATABASE GUARDS: Do NOT mention 'Unnamed Compound', 'ChEMBL', 'PubChem', 'database listings', 'clinical phases', 'assays', or 'target organisms'.\n"
41
+ "- IDENTIFIER GUARDS: Do NOT output raw chemical identifiers like SMILES, InChI keys, or CIDs unless specifically asked.\n"
42
+ "- TONE & FORMATTING: Use complete sentences and weave facts into one continuous, natural paragraph. Do NOT use colons, bullet points, numbered lists, or robotic boilerplate language.\n\n"
 
43
  f"Question: {message}<|end|>\n"
44
  "<|assistant|>\n"
45
  )
 
48
  output = llm(
49
  prompt,
50
  max_tokens=512,
51
+ temperature=0.1,
52
  top_p=0.9,
53
  repeat_penalty=1.1,
54
  stop=["<|end|>", "<|user|>"],