Spaces:
Build error
Build error
Update wavjourney_cli.py
Browse files- wavjourney_cli.py +4 -3
wavjourney_cli.py
CHANGED
|
@@ -8,7 +8,6 @@ parser = argparse.ArgumentParser()
|
|
| 8 |
parser.add_argument('-f', '--full', action='store_true', help='Go through the full process')
|
| 9 |
parser.add_argument('--input-text', type=str, default='', help='input text or text file')
|
| 10 |
parser.add_argument('--session-id', type=str, default='', help='session id, if set to empty, system will allocate an id')
|
| 11 |
-
parser.add_argument('--api-key', type=str, default='', help='api key used for GPT-4')
|
| 12 |
args = parser.parse_args()
|
| 13 |
|
| 14 |
if args.full:
|
|
@@ -16,11 +15,13 @@ if args.full:
|
|
| 16 |
|
| 17 |
start_time = time.time()
|
| 18 |
session_id = pipeline.init_session(args.session_id)
|
| 19 |
-
api_key =
|
|
|
|
|
|
|
| 20 |
|
| 21 |
print(f"Session {session_id} is created.")
|
| 22 |
|
| 23 |
pipeline.full_steps(session_id, input_text, api_key)
|
| 24 |
end_time = time.time()
|
| 25 |
|
| 26 |
-
print(f"WavJourney took {end_time - start_time:.2f} seconds to complete.")
|
|
|
|
| 8 |
parser.add_argument('-f', '--full', action='store_true', help='Go through the full process')
|
| 9 |
parser.add_argument('--input-text', type=str, default='', help='input text or text file')
|
| 10 |
parser.add_argument('--session-id', type=str, default='', help='session id, if set to empty, system will allocate an id')
|
|
|
|
| 11 |
args = parser.parse_args()
|
| 12 |
|
| 13 |
if args.full:
|
|
|
|
| 15 |
|
| 16 |
start_time = time.time()
|
| 17 |
session_id = pipeline.init_session(args.session_id)
|
| 18 |
+
api_key = utils.get_api_key()
|
| 19 |
+
|
| 20 |
+
assert api_key != None, "Please set your openai_key in the environment variable."
|
| 21 |
|
| 22 |
print(f"Session {session_id} is created.")
|
| 23 |
|
| 24 |
pipeline.full_steps(session_id, input_text, api_key)
|
| 25 |
end_time = time.time()
|
| 26 |
|
| 27 |
+
print(f"WavJourney took {end_time - start_time:.2f} seconds to complete.")
|