Kezovic commited on
Commit
8f34be1
·
verified ·
1 Parent(s): 1ea7808

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -8,7 +8,7 @@ MODEL_REPO = "Kezovic/iris-q4gguf-nitrallora"
8
  MODEL_FILE = "Llama-3.2-1B-Instruct.Q4_K_M.gguf"
9
  CONTEXT_WINDOW = 2048
10
  MAX_NEW_TOKENS = 400
11
- TEMPERATURE = 0.7 # Note: min_p = 0.1 is kept as requested in the configuration from the previous prompt
12
 
13
  # --- Model Loading ---
14
  llm = None
@@ -106,9 +106,7 @@ def analyze_poem(poem_text, progress=gr.Progress()):
106
  # Secondary prompt for the analysis task - MINIMALIST QUESTION
107
  # The prompt is simplified to remove conversational fluff and simply present the poem for analysis.
108
  poet_prompt = (
109
- f"You are a literary analyst. Your task is to analyze the POEM below and identify the single most appropriate "
110
- f"REAL, historical poet whose style and themes match the poem. Do NOT suggest fictional characters.\n"
111
- f"STRICT OUTPUT FORMAT: Format your answer ONLY as: Poet Name: [Name] - Justification: [Reason].\n\n"
112
  f"POEM:\n{poem_text}\n"
113
  )
114
 
@@ -116,8 +114,7 @@ def analyze_poem(poem_text, progress=gr.Progress()):
116
  prompt=poet_prompt,
117
  max_tokens=200, # Keep this response short
118
  temperature=0.4,
119
- # Minimal stop sequences for clean output
120
- stop=["POEM:", "STRICT OUTPUT FORMAT:", "\n\n", "\n"],
121
  echo=False
122
  )
123
 
 
8
  MODEL_FILE = "Llama-3.2-1B-Instruct.Q4_K_M.gguf"
9
  CONTEXT_WINDOW = 2048
10
  MAX_NEW_TOKENS = 400
11
+ TEMPERATURE = 0.4 # Note: min_p = 0.1 is kept as requested in the configuration from the previous prompt
12
 
13
  # --- Model Loading ---
14
  llm = None
 
106
  # Secondary prompt for the analysis task - MINIMALIST QUESTION
107
  # The prompt is simplified to remove conversational fluff and simply present the poem for analysis.
108
  poet_prompt = (
109
+ f"Give 5 sentence analysis of the poem below."
 
 
110
  f"POEM:\n{poem_text}\n"
111
  )
112
 
 
114
  prompt=poet_prompt,
115
  max_tokens=200, # Keep this response short
116
  temperature=0.4,
117
+ # Minimal stop sequences for clean output
 
118
  echo=False
119
  )
120