# Docs for v1 can be found by changing the above selector ^
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
current_dir = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(current_dir, "data.jsonl")
file = client.files.upload(file=file_path)
print(file.id){
"id": "<string>",
"object": "<unknown>",
"created_at": 123,
"filename": "my_file.jsonl",
"bytes": 123,
"purpose": "fine-tune",
"Processed": true,
"FileType": "jsonl"
}Upload a file with specified purpose, file name, and file type.
# Docs for v1 can be found by changing the above selector ^
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
current_dir = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(current_dir, "data.jsonl")
file = client.files.upload(file=file_path)
print(file.id){
"id": "<string>",
"object": "<unknown>",
"created_at": 123,
"filename": "my_file.jsonl",
"bytes": 123,
"purpose": "fine-tune",
"Processed": true,
"FileType": "jsonl"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The purpose of the file
fine-tune, eval, eval-sample, eval-output, eval-summary, batch-generated, batch-api "fine-tune"
The name of the file being uploaded
"dataset.csv"
The content of the file being uploaded
The type of the file
csv, jsonl, parquet "jsonl"
File uploaded successfully
Structured information describing a file uploaded to Together.
ID of the file.
The object type, which is always file.
The timestamp when the file was created.
The name of the file as it was uploaded.
"my_file.jsonl"
The number of bytes in the file.
The purpose of the file as it was uploaded.
fine-tune, eval, eval-sample, eval-output, eval-summary, batch-generated, batch-api "fine-tune"
Whether the file has been parsed and analyzed for correctness for fine-tuning.
The type of the file such as jsonl, csv, or parquet.
csv, jsonl, parquet "jsonl"
Was this page helpful?