Spaces:
Paused
Paused
Commit
·
9f3822d
1
Parent(s):
fb353ba
Update app.py
Browse files
app.py
CHANGED
|
@@ -173,6 +173,8 @@ def generate_text(prompt):
|
|
| 173 |
# return result
|
| 174 |
logging.set_verbosity(logging.CRITICAL)
|
| 175 |
# prompt = input()
|
|
|
|
|
|
|
| 176 |
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=100)
|
| 177 |
result = pipe(f"<s>[INST] {prompt} [/INST]")
|
| 178 |
output = result[0]['generated_text']
|
|
|
|
| 173 |
# return result
|
| 174 |
logging.set_verbosity(logging.CRITICAL)
|
| 175 |
# prompt = input()
|
| 176 |
+
additional_prompt = "If the following question is not related to medical domain or hospital domain, Do not answer. \n"
|
| 177 |
+
prompt = additional_prompt + prompt
|
| 178 |
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=100)
|
| 179 |
result = pipe(f"<s>[INST] {prompt} [/INST]")
|
| 180 |
output = result[0]['generated_text']
|