Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -76,9 +76,7 @@ Set the environment variable `model` to change the model:
|
|
76 |
['AIML-TUDA/LlavaGuard-13B'](https://huggingface.co/AIML-TUDA/LlavaGuard-13B),
|
77 |
['AIML-TUDA/LlavaGuard-34B'](https://huggingface.co/AIML-TUDA/LlavaGuard-34B),
|
78 |
"""
|
79 |
-
# set_up_env_and_token(read=True)
|
80 |
print(f"args: {gws.args}")
|
81 |
-
# set the huggingface login token
|
82 |
controller_proc = start_controller()
|
83 |
concurrency_count = int(os.getenv("concurrency_count", 5))
|
84 |
api_key = os.getenv("token")
|
@@ -94,13 +92,15 @@ Set the environment variable `model` to change the model:
|
|
94 |
models = [
|
95 |
'LukasHug/LlavaGuard-7B-hf',
|
96 |
'LukasHug/LlavaGuard-13B-hf',
|
97 |
-
'LukasHug/LlavaGuard-34B-hf',
|
|
|
|
|
98 |
bits = int(os.getenv("bits", 16))
|
99 |
-
model = os.getenv("model", models[
|
100 |
available_devices = os.getenv("CUDA_VISIBLE_DEVICES", "0")
|
101 |
model_path, model_name = model, model.split("/")[-1]
|
102 |
|
103 |
-
|
104 |
|
105 |
|
106 |
# Wait for worker and controller to start
|
@@ -122,7 +122,7 @@ Set the environment variable `model` to change the model:
|
|
122 |
print(e)
|
123 |
exit_status = 1
|
124 |
finally:
|
125 |
-
|
126 |
controller_proc.kill()
|
127 |
|
128 |
sys.exit(exit_status)
|
|
|
76 |
['AIML-TUDA/LlavaGuard-13B'](https://huggingface.co/AIML-TUDA/LlavaGuard-13B),
|
77 |
['AIML-TUDA/LlavaGuard-34B'](https://huggingface.co/AIML-TUDA/LlavaGuard-34B),
|
78 |
"""
|
|
|
79 |
print(f"args: {gws.args}")
|
|
|
80 |
controller_proc = start_controller()
|
81 |
concurrency_count = int(os.getenv("concurrency_count", 5))
|
82 |
api_key = os.getenv("token")
|
|
|
92 |
models = [
|
93 |
'LukasHug/LlavaGuard-7B-hf',
|
94 |
'LukasHug/LlavaGuard-13B-hf',
|
95 |
+
'LukasHug/LlavaGuard-34B-hf',
|
96 |
+
'liuhaotian/llava-v1.6-vicuna-7b',
|
97 |
+
]
|
98 |
bits = int(os.getenv("bits", 16))
|
99 |
+
model = os.getenv("model", models[-1])
|
100 |
available_devices = os.getenv("CUDA_VISIBLE_DEVICES", "0")
|
101 |
model_path, model_name = model, model.split("/")[-1]
|
102 |
|
103 |
+
worker_proc = start_worker(model_path, model_name, bits=bits)
|
104 |
|
105 |
|
106 |
# Wait for worker and controller to start
|
|
|
122 |
print(e)
|
123 |
exit_status = 1
|
124 |
finally:
|
125 |
+
worker_proc.kill()
|
126 |
controller_proc.kill()
|
127 |
|
128 |
sys.exit(exit_status)
|