Added Lama-with-refiner

This commit is contained in:
jarvis2324 2023-08-09 00:06:00 +05:30
parent db8a9fa5cd
commit f91229ef55
3 changed files with 43 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "lama-with-refiner"]
path = lama-with-refiner
url = https://github.com/Sharda-Tech/lama-with-refiner

1
lama-with-refiner Submodule

@ -0,0 +1 @@
Subproject commit f10e6763109989f52786f2ab5e9267d2f25df39c

39
test_api_runpod.py Normal file
View File

@ -0,0 +1,39 @@
import requests
import time
import json
# Load data from external JSON file
with open("test_input_ex.json", "r") as json_file:
data = json.load(json_file)
url = "https://api.runpod.ai/v2/vuusai5vaeia2x/runsync"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer T1530GW4R81PRD3MHSQGHJOI9D3GZG5Y4K7BTK0G"
}
response = requests.post(url, json=data, headers=headers)
response_data = response.json()
print("Response Data",response_data)
# if "run_id" in response_data:
# run_id = response_data["run_id"]
# print(f"Successfully started run with ID: {run_id}")
# # Now, let's wait for the result
# while True:
# status_response = requests.get(f"{url}/{run_id}", headers=headers)
# status_data = status_response.json()
# if status_data.get("status") == "finished":
# print("Run finished!")
# # You can access the result in status_data["result"]
# break
# elif status_data.get("status") == "failed":
# print("Run failed.")
# break
# time.sleep(5) # Wait for 5 seconds before checking again
# else:
# print("Failed to start the run.")