randydev commited on
Commit
444ad22
·
verified ·
1 Parent(s): ca36c95
Files changed (1) hide show
  1. akn/Gemini/gemini.py +4 -3
akn/Gemini/gemini.py CHANGED
@@ -53,12 +53,13 @@ async def remove_bg_myapi(return_image):
53
  payload = {
54
  "image_base64": encoded_string
55
  }
 
56
  response = requests.post("https://randydev-meta-ai.hf.space/remove-bg-base64", json=payload)
57
  if response.status_code == 200:
58
  result_base64 = response.json().get("output_image_base64")
59
- with open("output.png", "wb") as out_file:
60
  out_file.write(base64.b64decode(result_base64))
61
- return return_image
62
  else:
63
  return None
64
 
@@ -173,7 +174,7 @@ async def chatbot_talk(client: Client, message: Message):
173
  new_js = await message.reply_text("Please wait, it's still being processed")
174
  response_path = await remove_bg_myapi(file_path)
175
  if not response_path:
176
- return await message.reply_text("Error try remover bg")
177
  await new_js.edit_text("Uploading image completed...")
178
  await message.reply_photo(
179
  response_path,
 
53
  payload = {
54
  "image_base64": encoded_string
55
  }
56
+ output_bg = "output.png"
57
  response = requests.post("https://randydev-meta-ai.hf.space/remove-bg-base64", json=payload)
58
  if response.status_code == 200:
59
  result_base64 = response.json().get("output_image_base64")
60
+ with open(output_bg, "wb") as out_file:
61
  out_file.write(base64.b64decode(result_base64))
62
+ return output_bg
63
  else:
64
  return None
65
 
 
174
  new_js = await message.reply_text("Please wait, it's still being processed")
175
  response_path = await remove_bg_myapi(file_path)
176
  if not response_path:
177
+ return await new_js.edit_text("Error try remover bg")
178
  await new_js.edit_text("Uploading image completed...")
179
  await message.reply_photo(
180
  response_path,