This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
351 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import gc | ||
import argparse | ||
|
||
from send_request import send_request | ||
|
||
def chatting(args): | ||
""" | ||
main entry point | ||
""" | ||
|
||
data = { | ||
"api_key": str(args.api_key), | ||
"user": str(args.user), | ||
"data_id": str(args.data_id), | ||
"question": str(args.question) | ||
} | ||
|
||
result = send_request(args.api_url, data) | ||
|
||
gc.collect() | ||
|
||
print(result) | ||
|
||
if __name__ == "__main__": | ||
""" | ||
Form command lines | ||
""" | ||
# Clean up buffer memory | ||
gc.collect() | ||
|
||
user = "user@gmail.com" | ||
api_key = "AMEYbpdcmrUxNu_Fb80qutukUZdlsmYiH4g7As5LzNA" | ||
data_id = "" | ||
api_url = "http://localhost:8000/conversation" | ||
question = "hi" | ||
|
||
# Add options | ||
p = argparse.ArgumentParser() | ||
p = argparse.ArgumentParser(description="Translate text within an image.") | ||
p.add_argument("--api_url", type=str, default=api_url, help="URL to send the POST request to") | ||
p.add_argument("--data_id", type=str, default=data_id, help="payload directory to the test example") | ||
p.add_argument("--user", type=str, default=user, help="user") | ||
p.add_argument("--question", type=str, default=question, help="user's question") | ||
p.add_argument("--api_key", type=str, default=api_key, help="api key") | ||
args = p.parse_args() | ||
|
||
|
||
chatting(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import gc | ||
import argparse | ||
|
||
from send_request import send_request | ||
|
||
def check_api_key(args): | ||
""" | ||
main entry point | ||
""" | ||
|
||
data = { | ||
"api_key": str(args.api_key), | ||
"user": str(args.user), | ||
"data_id": str(args.data_id) | ||
} | ||
|
||
result = send_request(args.api_url, data) | ||
|
||
gc.collect() | ||
|
||
print(result) | ||
|
||
if __name__ == "__main__": | ||
""" | ||
Form command lines | ||
""" | ||
# Clean up buffer memory | ||
gc.collect() | ||
|
||
user = "user@gmail.com" | ||
api_key = "AMEYbpdcmrUxNu_Fb80qutukUZdlsmYiH4g7As5LzNA" | ||
data_id = "" | ||
api_url = "http://localhost:8000/check_api" | ||
|
||
# Add options | ||
p = argparse.ArgumentParser() | ||
p = argparse.ArgumentParser(description="Translate text within an image.") | ||
p.add_argument("--api_url", type=str, default=api_url, help="URL to send the POST request to") | ||
p.add_argument("--data_id", type=str, default=data_id, help="payload directory to the test example") | ||
p.add_argument("--user", type=str, default=user, help="user") | ||
p.add_argument("--api_key", type=str, default=api_key, help="api key") | ||
args = p.parse_args() | ||
|
||
check_api_key(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import gc | ||
import argparse | ||
|
||
from send_request import send_request | ||
|
||
def create_api_key(args): | ||
""" | ||
main entry point | ||
""" | ||
|
||
data = { | ||
"user": str(args.user), | ||
"title": str(args.title), | ||
"description": str(args.description), | ||
"data_id": str(args.data_id) | ||
} | ||
|
||
result = send_request(args.api_url, data) | ||
|
||
gc.collect() | ||
|
||
print(result) | ||
|
||
if __name__ == "__main__": | ||
""" | ||
Form command lines | ||
""" | ||
# Clean up buffer memory | ||
gc.collect() | ||
|
||
user = "user@gmail.com" | ||
title = "title" | ||
description = "description" | ||
data_id = "" | ||
api_url = "http://localhost:8000/create_api" | ||
|
||
# Add options | ||
p = argparse.ArgumentParser() | ||
p = argparse.ArgumentParser(description="Translate text within an image.") | ||
p.add_argument("--api_url", type=str, default=api_url, help="URL to send the POST request to") | ||
p.add_argument("--data_id", type=str, default=data_id, help="payload directory to the test example") | ||
p.add_argument("--user", type=str, default=user, help="user") | ||
p.add_argument("--title", type=str, default=title, help="title") | ||
p.add_argument("--description", type=str, default=description, help="title") | ||
args = p.parse_args() | ||
|
||
create_api_key(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import gc | ||
import argparse | ||
|
||
from send_request import send_request | ||
|
||
def delete_api_key(args): | ||
""" | ||
main entry point | ||
""" | ||
|
||
data = { | ||
"api_key": str(args.api_key), | ||
"user": str(args.user), | ||
"data_id": str(args.data_id) | ||
} | ||
|
||
result = send_request(args.api_url, data) | ||
|
||
gc.collect() | ||
|
||
print(result) | ||
|
||
if __name__ == "__main__": | ||
""" | ||
Form command lines | ||
""" | ||
# Clean up buffer memory | ||
gc.collect() | ||
|
||
user = "user@gmail.com" | ||
api_key = "AMEYbpdcmrUxNu_Fb80qutukUZdlsmYiH4g7As5LzNA" | ||
data_id = "" | ||
api_url = "http://localhost:8000/delete_api" | ||
|
||
# Add options | ||
p = argparse.ArgumentParser() | ||
p = argparse.ArgumentParser(description="Translate text within an image.") | ||
p.add_argument("--api_url", type=str, default=api_url, help="URL to send the POST request to") | ||
p.add_argument("--data_id", type=str, default=data_id, help="payload directory to the test example") | ||
p.add_argument("--user", type=str, default=user, help="user") | ||
p.add_argument("--api_key", type=str, default=api_key, help="api key") | ||
args = p.parse_args() | ||
|
||
|
||
delete_api_key(args) |
Oops, something went wrong.