Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,12 @@ model = AutoModelForCausalLM.from_pretrained("MiaoshouAI/Florence-2-base-PromptG
|
|
11 |
processor = AutoProcessor.from_pretrained("MiaoshouAI/Florence-2-base-PromptGen-v1.5", trust_remote_code=True)
|
12 |
|
13 |
@spaces.GPU(duration=180)
|
14 |
-
def infer(prompt, image):
|
|
|
|
|
|
|
|
|
|
|
15 |
max_size = 256
|
16 |
width, height = image.size
|
17 |
if width > height:
|
|
|
11 |
processor = AutoProcessor.from_pretrained("MiaoshouAI/Florence-2-base-PromptGen-v1.5", trust_remote_code=True)
|
12 |
|
13 |
@spaces.GPU(duration=180)
|
14 |
+
def infer(prompt, image, request: gr.Request):
|
15 |
+
if request:
|
16 |
+
print("请求头字典:", request.headers)
|
17 |
+
print("IP 地址:", request.client.host)
|
18 |
+
print("查询参数:", dict(request.query_params))
|
19 |
+
print("会话哈希:", request.session_hash)
|
20 |
max_size = 256
|
21 |
width, height = image.size
|
22 |
if width > height:
|