You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
412 B
Python
16 lines
412 B
Python
import requests
|
|
|
|
# 定义上传文件的URL
|
|
url = "http://localhost:3397/upload_model/"
|
|
|
|
# 打开要上传的模型文件
|
|
file_path = "train_api/train_model_20240605_172031.pth" # 替换为你要上传的模型文件路径
|
|
files = {'file': open(file_path, 'rb')}
|
|
|
|
# 发送POST请求上传文件
|
|
response = requests.post(url, files=files)
|
|
|
|
# 打印响应结果
|
|
print(response.status_code)
|
|
print(response.json())
|