From f91229ef55817bc2f6d8c7bfd92aafc76c40827d Mon Sep 17 00:00:00 2001 From: jarvis2324 Date: Wed, 9 Aug 2023 00:06:00 +0530 Subject: [PATCH] Added Lama-with-refiner --- .gitmodules | 3 +++ lama-with-refiner | 1 + test_api_runpod.py | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .gitmodules create mode 160000 lama-with-refiner create mode 100644 test_api_runpod.py diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..8d3d3017f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lama-with-refiner"] + path = lama-with-refiner + url = https://github.com/Sharda-Tech/lama-with-refiner diff --git a/lama-with-refiner b/lama-with-refiner new file mode 160000 index 000000000..f10e67631 --- /dev/null +++ b/lama-with-refiner @@ -0,0 +1 @@ +Subproject commit f10e6763109989f52786f2ab5e9267d2f25df39c diff --git a/test_api_runpod.py b/test_api_runpod.py new file mode 100644 index 000000000..1077e72be --- /dev/null +++ b/test_api_runpod.py @@ -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.")