vitorandrade commited on
Commit
31c8681
verified
1 Parent(s): ef10c15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -44,6 +44,9 @@ def generate_response(model, tokenizer, prompt, max_length=512, num_return_seque
44
  # Tokenizar a resposta gerada
45
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
46
 
 
 
 
47
  # Encontrar o in铆cio da resposta (ap贸s "###Resposta:")
48
  response_start_index = response.find("### Resposta:") + len("### Resposta:")
49
  response_text = response[response_start_index:].strip()
 
44
  # Tokenizar a resposta gerada
45
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
46
 
47
+ # Extrair a parte revelante da resposta
48
+ response = responde.split("### Resposta: ")[-1].strip()
49
+
50
  # Encontrar o in铆cio da resposta (ap贸s "###Resposta:")
51
  response_start_index = response.find("### Resposta:") + len("### Resposta:")
52
  response_text = response[response_start_index:].strip()