Update app.py
Browse files
app.py
CHANGED
@@ -18,9 +18,10 @@ subprocess.run(
|
|
18 |
|
19 |
shell=True,
|
20 |
)
|
21 |
-
|
22 |
-
|
23 |
-
print(f"
|
|
|
24 |
|
25 |
subprocess.run(
|
26 |
"pip install flash-attn --no-build-isolation",
|
@@ -82,7 +83,7 @@ def respond(
|
|
82 |
temperature,
|
83 |
top_p,
|
84 |
):
|
85 |
-
|
86 |
messages = [{"role": "user", "content": "Hello, how are you?"}]
|
87 |
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to('cuda')
|
88 |
## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
|
|
|
18 |
|
19 |
shell=True,
|
20 |
)
|
21 |
+
def print_s1ystem():
|
22 |
+
ram_info = psutil.virtual_memory()
|
23 |
+
print(f"Total RAM: {ram_info.total / (1024.0 ** 3)} GB")
|
24 |
+
print(f"Available RAM: {ram_info.available / (1024.0 ** 3)} GB")
|
25 |
|
26 |
subprocess.run(
|
27 |
"pip install flash-attn --no-build-isolation",
|
|
|
83 |
temperature,
|
84 |
top_p,
|
85 |
):
|
86 |
+
print_s1ystem()
|
87 |
messages = [{"role": "user", "content": "Hello, how are you?"}]
|
88 |
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to('cuda')
|
89 |
## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
|