Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,14 +8,14 @@ tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-base")
|
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
-
prompt=''' Review the Following text as a human, who is tasked to Extract `Code Snippets` ,if any. If there are no Code Snippets in the below Text then return No CODE HIDDEN:
|
| 12 |
|
| 13 |
-
"{}"
|
| 14 |
-
'''
|
| 15 |
def reply(message, history):
|
| 16 |
m=message.replace('\n','')
|
| 17 |
m=m.replace('\t','')
|
| 18 |
-
inputs = tokenizer(
|
|
|
|
|
|
|
|
|
|
| 19 |
outputs = model.generate(**inputs)
|
| 20 |
code=tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 21 |
return code
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
|
|
|
|
| 11 |
|
|
|
|
|
|
|
| 12 |
def reply(message, history):
|
| 13 |
m=message.replace('\n','')
|
| 14 |
m=m.replace('\t','')
|
| 15 |
+
inputs = tokenizer(f''' Review the Following text as a human, who is tasked to Extract `Code Snippets` ,if any. If there are no Code Snippets in the below Text then return No CODE HIDDEN:
|
| 16 |
+
|
| 17 |
+
"{message}"
|
| 18 |
+
''', return_tensors="pt")
|
| 19 |
outputs = model.generate(**inputs)
|
| 20 |
code=tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 21 |
return code
|