Update README, add final results, add util scripts to query based on user input.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import requests
|
||||
API_URL = "http://localhost:8000/compare"
|
||||
|
||||
def call_api(headline):
|
||||
try:
|
||||
response = requests.post(
|
||||
API_URL,
|
||||
json={"event": headline}
|
||||
)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
|
||||
return data["lora_output"]
|
||||
|
||||
except Exception as e:
|
||||
print(f"[ERROR] API failed for: {headline}")
|
||||
print(e)
|
||||
return None, None
|
||||
|
||||
|
||||
while(True):
|
||||
headline = input()
|
||||
if (headline == "none"):
|
||||
break
|
||||
results = call_api(headline)
|
||||
|
||||
for result in results:
|
||||
print(result.split("\n")[0])
|
||||
Reference in New Issue
Block a user