contributing md

Former-commit-id: 26c0a67851
bing-chat^2
Kye 1 year ago
parent 36a78e2561
commit b47b2e694a

@ -163,7 +163,7 @@ For documentation, go here, [swarms.apac.ai](https://swarms.apac.ai)
----- -----
## Contribute ## Contribute
We're always looking for contributors to help us improve and expand this project. If you're interested, please check out our [Contributing Guidelines](C0NTRIBUTING.md). We're always looking for contributors to help us improve and expand this project. If you're interested, please check out our [Contributing Guidelines](CONTRIBUTING.md).
### Optimization Priorities ### Optimization Priorities

@ -16,16 +16,17 @@ class MultiModalLlava:
top_k: The top k value for sampling top_k: The top k value for sampling
repetition_penalty: The repetition penalty for sampling repetition_penalty: The repetition penalty for sampling
device_map: The device map to use device_map: The device map to use
Methods: Methods:
__call__: Call the model __call__: Call the model
chat: Interactive chat in terminal chat: Interactive chat in terminal
Example: Example:
>>> from swarms.models.llava import LlavaModel >>> from swarms.models.llava import LlavaModel
>>> model = LlavaModel(device="cpu") >>> model = LlavaModel(device="cpu")
>>> model("Hello, I am a robot.") >>> model("Hello, I am a robot.")
""" """
def __init__( def __init__(
self, self,
model_name_or_path="TheBloke/llava-v1.5-13B-GPTQ", model_name_or_path="TheBloke/llava-v1.5-13B-GPTQ",
@ -37,7 +38,7 @@ class MultiModalLlava:
top_p=0.95, top_p=0.95,
top_k=40, top_k=40,
repetition_penalty=1.1, repetition_penalty=1.1,
device_map: str = "auto" device_map: str = "auto",
): ):
self.device = device self.device = device
self.model = AutoModelForCausalLM.from_pretrained( self.model = AutoModelForCausalLM.from_pretrained(
@ -76,4 +77,3 @@ class MultiModalLlava:
break break
response = self(user_input) response = self(user_input)
print(f"Model: {response}") print(f"Model: {response}")

Loading…
Cancel
Save