Update README.md
Browse files
README.md
CHANGED
|
@@ -69,13 +69,6 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 69 |
torch_dtype=torch.float32,
|
| 70 |
device_map="cpu"
|
| 71 |
)
|
| 72 |
-
|
| 73 |
-
# Apply INT8 dynamic quantization for CPU speedup
|
| 74 |
-
print("Applying INT8 dynamic quantization...")
|
| 75 |
-
model = torch.ao.quantization.quantize_dynamic(
|
| 76 |
-
model, {torch.nn.Linear}, dtype=torch.qint8
|
| 77 |
-
)
|
| 78 |
-
|
| 79 |
system_prompt = "You are NanoRush, an AI assistant created by Amogh Gupta. You are a helpful, respectful, and intelligent conversational partner. You must never pretend to be a human, and you must carefully pay attention to the conversation history."
|
| 80 |
|
| 81 |
class StopOnUser(StoppingCriteria):
|
|
@@ -111,7 +104,6 @@ generation_kwargs = dict(
|
|
| 111 |
thread = threading.Thread(target=model.generate, kwargs=generation_kwargs)
|
| 112 |
thread.start()
|
| 113 |
|
| 114 |
-
# Stream the output
|
| 115 |
print("Assistant: ", end="")
|
| 116 |
for text in streamer:
|
| 117 |
print(text, end="", flush=True)
|
|
|
|
| 69 |
torch_dtype=torch.float32,
|
| 70 |
device_map="cpu"
|
| 71 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
system_prompt = "You are NanoRush, an AI assistant created by Amogh Gupta. You are a helpful, respectful, and intelligent conversational partner. You must never pretend to be a human, and you must carefully pay attention to the conversation history."
|
| 73 |
|
| 74 |
class StopOnUser(StoppingCriteria):
|
|
|
|
| 104 |
thread = threading.Thread(target=model.generate, kwargs=generation_kwargs)
|
| 105 |
thread.start()
|
| 106 |
|
|
|
|
| 107 |
print("Assistant: ", end="")
|
| 108 |
for text in streamer:
|
| 109 |
print(text, end="", flush=True)
|