Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mnt: clean repo and remove Makefile #3

Merged
merged 6 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed util.h and place it in encodec.cpp
  • Loading branch information
PABannier committed Oct 1, 2023
commit 04e9b86ce0937fa9ee79181778a2dc21cc8d4ad7
12 changes: 8 additions & 4 deletions encodec.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#include "encodec.h"
#include "ggml.h"
#include "util.h"

#include <cmath>
#include <stdexcept>
#include <fstream>
#include <map>
#include <string>
#include <vector>

#include "encodec.h"
#include "ggml.h"

template<typename T>
static void read_safe(std::ifstream& infile, T& dest) {
infile.read((char*)& dest, sizeof(T));
}

static int get_extra_padding_for_conv_1d(ggml_tensor * inp, float kernel_size, float stride, float padding_total) {
float length = inp->ne[0];
float n_frames = (length - kernel_size + padding_total) / stride + 1.0f;
Expand Down
13 changes: 13 additions & 0 deletions encodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
#include <string>
#include <vector>

#define ENCODEC_FILE_MAGIC 'ggml'
#define ENCODEC_FILE_VERSION 1

#define ENCODEC_ASSERT(x) \
do { \
if (!(x)) { \
fprintf(stderr, "ENCODEC_ASSERT: %s:%d: %s\n", __FILE__, __LINE__, #x); \
abort(); \
} \
} while (0)

static const size_t MB = 4*1024*1024;

struct encodec_hparams {
int32_t in_channels = 1;
int32_t hidden_dim = 128;
Expand Down
21 changes: 0 additions & 21 deletions util.h

This file was deleted.