Code Monkey home page Code Monkey logo

llama2's Introduction

๐Ÿฆ™๐Ÿ’ฌ Llama 2 Chat

This chatbot is created using the open-source Llama 2 LLM model from Meta.

Particularly, we're using the Llama2-7B model deployed by the Andreessen Horowitz (a16z) team and hosted on the Replicate platform.

This app was refactored from a16z's implementation of their LLaMA2 Chatbot to be light-weight for deployment to the Streamlit Community Cloud.

Demo App

Streamlit App

Prerequisite libraries

streamlit
replicate

Getting your own Replicate API token

To use this app, you'll need to get your own Replicate API token.

After signing up to Replicate, you can access your API token from this page.

Other Llama 2 models to try

As mentioned above, this chatbot implementation uses the Llama2-7B model that was trained on 7 billion parameters.

You can also try out the larger models:

Further Reading

llama2's People

Contributors

dataprofessor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

llama2's Issues

Running Llama in local

Hello
When I try to run the Llama2-local script, I get this error :
ValueError: Model path does not exist: models\llama-2-7b-chat.ggmlv3.q2_K.bin

Any ideas ?

Don't have to simulate typewriter effect in streamlit_app.py

In streamlit_app.py, typewriter effect is simulated by the following code.
response = generate_llama2_response(prompt)
placeholder = st.empty()
full_response = ''
for item in response:
full_response += item
placeholder.markdown(full_response)
placeholder.markdown(full_response)

That's NOT a neat implementation because you can't display the partial response until the full response is received, esp. for the long response. The good example is available on replicate website. https://replicate.com/docs/get-started/python.

Some models stream output as the model is running. They will return an iterator, and you can iterate over that output

iterator = replicate.run(
"mistralai/mixtral-8x7b-instruct-v0.1",
input={"prompt": "Who was Dolly the sheep?"},
)
for text in iterator:
print(text)

Hopefully llama2 can return an iterator.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.