FerrellSyntheticIntelligence's picture
Upload folder using huggingface_hub
d2a5f5a verified
Raw
History Blame Contribute Delete
425 Bytes
import sys, json, urllib.request
def main():
prompt = " ".join(sys.argv[1:])
data = json.dumps({"prompt": prompt}).encode()
req = urllib.request.Request(
"http://localhost:5001/execute",
data=data,
headers={"Content-Type": "application/json"},
method="POST"
)
with urllib.request.urlopen(req) as resp:
print(json.load(resp))
if __name__ == "__main__":
main()