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.
Merge pull request #13 from loyal812/feat/refactor-project-with-one
refactor: project as one
- Loading branch information
Showing
14 changed files
with
275 additions
and
97 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
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,50 @@ | ||
import gc | ||
import argparse | ||
|
||
from send_request import send_request | ||
|
||
def total_process(args): | ||
""" | ||
main entry point | ||
""" | ||
|
||
data = { | ||
"user": str(args.user), | ||
"title": str(args.title), | ||
"description": str(args.description), | ||
"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" | ||
title = "title" | ||
description = "description" | ||
data_id = "" | ||
api_url = "http://localhost:5000/total" | ||
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("--title", type=str, default=title, help="title") | ||
p.add_argument("--description", type=str, default=description, help="title") | ||
p.add_argument("--question", type=str, default=question, help="user's question") | ||
args = p.parse_args() | ||
|
||
total_process(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
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,7 @@ | ||
from pydantic import BaseModel | ||
from typing import Optional | ||
|
||
class BasicModel(BaseModel): | ||
api_key: Optional[str] = "" | ||
user: Optional[str] = "" | ||
data_id: Optional[str] = "" |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.