MatteoScript commited on
Commit
33e9df8
·
1 Parent(s): 56eafc1

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -58,7 +58,7 @@ def read_root(request: Request, input_data: InputData):
58
 
59
  history = [] # Puoi definire la history se necessario
60
  generated_response = generate(input_text, history, temperature, max_new_tokens, top_p, repetition_penalty)
61
- return generated_response
62
 
63
  @app.post("/Immagine")
64
  def generate_image(request: Request, input_data: InputImage):
@@ -77,7 +77,7 @@ def generate_image(request: Request, input_data: InputImage):
77
  with open(image_url, 'rb') as img_file:
78
  img_binary = img_file.read()
79
  img_base64 = base64.b64encode(img_binary).decode('utf-8')
80
- return img_base64
81
 
82
  @app.get("/")
83
  def read_general():
 
58
 
59
  history = [] # Puoi definire la history se necessario
60
  generated_response = generate(input_text, history, temperature, max_new_tokens, top_p, repetition_penalty)
61
+ return {"response": generated_response}
62
 
63
  @app.post("/Immagine")
64
  def generate_image(request: Request, input_data: InputImage):
 
77
  with open(image_url, 'rb') as img_file:
78
  img_binary = img_file.read()
79
  img_base64 = base64.b64encode(img_binary).decode('utf-8')
80
+ return {"response": img_base64}
81
 
82
  @app.get("/")
83
  def read_general():