Spaces:
Sleeping
Sleeping
Commit ·
4caf2cc
1
Parent(s): c5f58d3
Update main.py
Browse files53 unmodified lines545556575859605758597 unmodified lines6768697475707172737475767753 unmodified lines generated_response = generate(input_text, history, temperature, max_new_tokens, top_p, repetition_penalty) return {"response": generated_response}
def get_ip_address(): ip_address = socket.gethostbyname(socket.gethostname()) return ip_address
@app.get("/Immagine")def generate_image(): client = Client("https://openskyml-fast-sdxl-stable-diffusion-xl.hf.space/--replicas/545b5tw7n/")7 unmodified lines 453666937, fn_index=0 ) image_url = get_ip_address() + result return {"response": image_url} image_url = result with open(image_url, 'rb') as img_file: img_binary = img_file.read() img_base64 = base64.b64encode(img_binary).decode('utf-8') return {"response": img_base64}
@app.get("/Test")def generate_image():main.py+5-6