krisha06 commited on
Commit
f4e31ac
·
verified ·
1 Parent(s): a61ec87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -10,11 +10,10 @@ model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
10
 
11
  # Chat function with prompt-based filtering
12
  def chat(instruction):
13
- prompt = f"""You are a helpful and expert Python programming tutor.
14
 
15
- Only answer questions that are clearly related to Python programming. Do not try to answer any questions that are greetings, general knowledge, or unrelated topics.
16
-
17
- If the question is not related to Python, simply respond with:
18
  "Sorry, I can only answer Python-related questions."
19
 
20
  ### Instruction:
 
10
 
11
  # Chat function with prompt-based filtering
12
  def chat(instruction):
13
+ prompt = """You are a helpful and expert Python programming tutor.
14
 
15
+ Only answer questions that are clearly related to Python programming.
16
+ If the question is not related to Python, respond with:
 
17
  "Sorry, I can only answer Python-related questions."
18
 
19
  ### Instruction: