-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* UI Changes: Standardised each section and buttons * UI Changes: Changes made according to suggestions * UI Changes: Python linting corrected! --------- Co-authored-by: Garvit Shah <[email protected]>
- Loading branch information
1 parent
b90fa2d
commit f25bc3b
Showing
5 changed files
with
92 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/bin/bash | ||
export API_KEY=APIKEY | ||
export MONGO_URI=MONGOURL | ||
python3 server.py |
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
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 |
---|---|---|
|
@@ -21,8 +21,10 @@ | |
cors = CORS(app) | ||
|
||
|
||
API_KEY = os.environ.get("GPTNEO", None) | ||
headers = {"Authorization": API_KEY} | ||
BART = os.environ.get("BART", None) | ||
ROBERTA = os.environ.get("BART", None) | ||
headersBart = {"Authorization": BART} | ||
headersRoberta = {"Authorization": ROBERTA} | ||
MONGO_URI = os.environ.get("mongo_uri","mongodb+srv://admin:[email protected]/") | ||
client = MongoClient(MONGO_URI, server_api=ServerApi("1")) | ||
try: | ||
|
@@ -44,14 +46,14 @@ def summarizer(text): | |
def query(payload): | ||
data = json.dumps(payload) | ||
response = requests.request( | ||
"POST", api_url_summarizer, headers=headers, data=data, timeout=10 | ||
"POST", api_url_summarizer, headers=headersBart, data=data, timeout=10 | ||
) | ||
return json.loads(response.content.decode("utf-8")) | ||
|
||
output = query( | ||
{ | ||
"inputs": text, | ||
"parameters": {"do_sample": False}, | ||
"parameters": {"min_length": 100}, | ||
} | ||
) | ||
print(output) | ||
|
@@ -68,7 +70,7 @@ def ask_qna(text): | |
def query(payload): | ||
data = json.dumps(payload) | ||
response = requests.request( | ||
"POST", api_url_qna, headers=headers, data=data, timeout=10 | ||
"POST", api_url_qna, headers=headersRoberta, data=data, timeout=10 | ||
) | ||
return json.loads(response.content.decode("utf-8")) | ||
|
||
|