Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,8 +37,8 @@ def generate_response(message, history):
|
|
| 37 |
|
| 38 |
with torch.no_grad():
|
| 39 |
text = model.generate(**inputs, max_new_tokens=256, do_sample=False)
|
| 40 |
-
start = text.find('<|object_ref_end|>') + len('<|object_ref_end|>')
|
| 41 |
-
end = text.find('<|box_end|>')
|
| 42 |
result = text[start:end]
|
| 43 |
return tokenizer.decode(result, skip_special_tokens=False)
|
| 44 |
chatbot = gr.ChatInterface(
|
|
|
|
| 37 |
|
| 38 |
with torch.no_grad():
|
| 39 |
text = model.generate(**inputs, max_new_tokens=256, do_sample=False)
|
| 40 |
+
start = text[0].find('<|object_ref_end|>') + len('<|object_ref_end|>')
|
| 41 |
+
end = text[0].find('<|box_end|>')
|
| 42 |
result = text[start:end]
|
| 43 |
return tokenizer.decode(result, skip_special_tokens=False)
|
| 44 |
chatbot = gr.ChatInterface(
|