Spaces:
Sleeping
Sleeping
Commit ·
4caf2cc
1
Parent(s): c5f58d3
Update main.py
Browse files53 unmodified lines545556575859606162637 unmodified lines717273747576777853 unmodified linesgenerated_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 lines453666937,fn_index=0)image_url = get_ip_address() + resultreturn {"response": image_url}@app.get("/Test")def generate_image():53 unmodified lines5455565758597 unmodified lines676869707172737475767753 unmodified linesgenerated_response = generate(input_text, history, temperature, max_new_tokens, top_p, repetition_penalty)return {"response": generated_response}@app.get("/Immagine")def generate_image():client = Client("https://openskyml-fast-sdxl-stable-diffusion-xl.hf.space/--replicas/545b5tw7n/")7 unmodified lines453666937,fn_index=0)image_url = resultwith 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