Comments (5)
I would recommend taking a look at https://www.sbert.net/ . To my best knowledge the OpenAI models are not outstanding at all for embeddings (https://huggingface.co/spaces/mteb/leaderboard) but it is convenience to use the API of them - at least for us.
from stablelm.
If it helps, I have successfully used: sentence-transformers/all-mpnet-base-v2
as an alternative to the OpenAI text-embedding-ada-002
from stablelm.
Hello, i am able to extract the embeddings from the model.
from transformers import AutoModelForCausalLM, AutoConfig,AutoTokenizer
checkpoint = "path/to/the/model"
config = AutoConfig.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_config(config)
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
inputs = tokenizer.encode('Stability AI democratised AI by open sourcing large models', return_tensors="pt")
outputs = model(inputs)
hidden_states = output[1]
now hidden states has output of all the layers. You can use the output of last layer.
Since i am a newbie to huggingface, there might be better ways to do this. Please share if you find something better.
from stablelm.
These models are multi-lingual?
from stablelm.
If you are looking for another convenient API might consider embaas. They offer a similiar structure to openai and you can use the MTEB leaderboard top members. They have some mutlilingual models as well and integrate wiht langchain or have an easy to use python client
from stablelm.
Related Issues (20)
- Any advice how to train a model of a different language? HOT 2
- What's the proper way to implement chatting feature? HOT 6
- RLHF training code for StableVicuna open sourced? HOT 1
- StableVicuna does not stop dialog speaking, probably until max_new_tokens. HOT 3
- loss not decreasing with deepspeed HOT 1
- Training Script stablity 3B and 7B HOT 6
- Unclear tokenizer class HOT 2
- Cannot run demo HOT 2
- fairyfloss HOT 2
- process killed HOT 4
- License unclear HOT 8
- Is it normal to take a long time ( about 15min )to generate an answer? HOT 1
- How to expand the sequence length of llama? HOT 1
- Consider using OpenAI Evals
- The output is the same as the input. HOT 1
- Is this project abandoned? HOT 4
- Stability AI
- Hello, how to convert the statityai/tablelm-base-alpha-3b to ggml format HOT 1
- Target modules ['query_key_value', 'dense', 'dense_h_to_4h', 'dense_4h_to_h'] not found in the base model. Please check the target modules and try again. HOT 2
- OSError: stabilityai/stablelm-base-alpha-3b-v2 does not appear to have a file named pytorch_model.bin, tf_model.h5, model.ckpt or flax_model.msgpack. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stablelm.