JSenkCC commited on
Commit
068aa58
·
verified ·
1 Parent(s): 157af84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -433,6 +433,8 @@ def validate_and_generate_documentation(api_url, headers, gemini_output, functio
433
  5. Return only the required information for the above tasks, and exclude everything else.
434
  """
435
 
 
 
436
  payload = {"inputs": prompt, "parameters": {"max_new_tokens": 1024}}
437
  response = requests.post(api_url, headers=headers, json=payload)
438
 
@@ -442,7 +444,7 @@ def validate_and_generate_documentation(api_url, headers, gemini_output, functio
442
  output = api_response.get("generated_text", "") if isinstance(api_response, dict) else api_response[0].get("generated_text", "")
443
 
444
  # Remove the Gemini content from the top of the Qwen output
445
- trimmed_output = output[gemini_output_length:].strip()
446
 
447
  return clean_output(trimmed_output) # Final cleanup if necessary
448
  else:
 
433
  5. Return only the required information for the above tasks, and exclude everything else.
434
  """
435
 
436
+ qwen_prompt_length = len(prompt)
437
+
438
  payload = {"inputs": prompt, "parameters": {"max_new_tokens": 1024}}
439
  response = requests.post(api_url, headers=headers, json=payload)
440
 
 
444
  output = api_response.get("generated_text", "") if isinstance(api_response, dict) else api_response[0].get("generated_text", "")
445
 
446
  # Remove the Gemini content from the top of the Qwen output
447
+ trimmed_output = output[gemini_output_length + qwen_prompt_length:].strip()
448
 
449
  return clean_output(trimmed_output) # Final cleanup if necessary
450
  else: