Skip to content

Commit

Permalink
Update README on quick start.
Browse files Browse the repository at this point in the history
  • Loading branch information
haotian-liu committed Nov 5, 2023
1 parent c62a168 commit b9fb8a8
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ pip install -e .
```Python
from llava.model.builder import load_pretrained_model
from llava.mm_utils import get_model_name_from_path
from llava.eval.run_llava import eval_model

model_path = "liuhaotian/llava-v1.5-7b"
model_name = get_model_name_from_path(model_path)
model_base = None

tokenizer, model, image_processor, context_len = load_pretrained_model(
model_path=model_path,
model_base=model_base,
model_name=model_name
model_base=None,
model_name=get_model_name_from_path(model_path)
)
```

Expand All @@ -113,25 +112,21 @@ Check out the details wth the `load_pretrained_model` function in `llava/model/b
You can also use the `eval_model` function in `llava/eval/run_llava.py` to get the output easily. By doing so, you can use this code on Colab directly after downloading this repository.

``` python
# import the file

model_path = "liuhaotian/llava-v1.5-7b"
model_name = get_model_name_from_path(model_path)
model_base = None
prompt = "Give me a short description of this image."
imageFile = "https://llava-vl.github.io/static/images/view.jpg"
prompt = "What are the things I should be cautious about when I visit here?"
image_file = "https://llava-vl.github.io/static/images/view.jpg"

args = type('Args', (), {
"model_path": model_path,
"model_base": model_base,
"model_name": model_name,
"model_base": None,
"model_name": get_model_name_from_path(model_path),
"query": prompt,
"conv_mode": None,
"image_file": imageFile
"image_file": image_file,
"sep": ",",
})()

output = eval_model(args)
print(output)
eval_model(args)
```
</details>

Expand Down

0 comments on commit b9fb8a8

Please sign in to comment.