File size: 1,131 Bytes
7f82313
 
fb68322
 
 
 
7f82313
 
fb68322
7f82313
 
fb68322
5447779
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fa69247
5447779
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
library_name: transformers
tags:
- time series
- embedding
license: mit
---

# MOMENT-1-large-embedding-v0.1

<!-- Provide a quick summary of what the model is/does. -->
This is an embedding model derived from [AutonLab/MOMENT-1-large](https://huggingface.co/AutonLab/MOMENT-1-large)

## How to use
```Python
from transformers import AutoConfig, AutoModel, AutoFeatureExtractor

model_name = "HachiML/MOMENT-1-large-embedding-v0.1"

model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name, trust_remote_code=True)
```

```Python
import torch

device = "cuda" if torch.cuda.is_available() else "cpu"
print(device)

model.to(device)
```

```Python
hist_ndaq = pd.DataFrame("nasdaq_price_history.csv")
input_data = hist_ndaq[["Open", "High", "Low", "Close", "Volume"]].iloc[:512]

inputs = feature_extractor(input_data, return_tensors="pt")
# inputs = feature_extractor([input_data, input_data_2], return_tensors="pt")  # You can also pass multiple data in a list.

inputs = inputs.to(device)
outputs = model(**inputs)
print(outputs.embeddings)
```