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

Minor updates #361

Merged
merged 3 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: '[Bug]: '
labels: ''
assignees: ''

Expand Down
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Feature request
title: '[Feature Request]: '
about: Suggest an idea for Infinity
labels: ''
---

**Summary**

Description for this feature.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/subtask.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Subtask
title: '[Subtask]: '
about: Subtask of an issue
labels: ''
---

**Summary**

Description for this subtask.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ int main() {
}

auto r = table->CreateIndex(index_name, index_info_list, CreateIndexOptions());
if (!r.IsOk()) {
std::cout << "Create index failed: " << r.ToString() << std::endl;
return 1;
if (r.IsOk()) {
r = infinity->Flush();
} else {
std::cout << "Fail to create index." << r.ToString() << std::endl;
}
std::cout << "Create index cost: " << profiler.ElapsedToString();
profiler.End();
Expand Down
30 changes: 14 additions & 16 deletions src/parser/type/complex/embedding_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,20 @@ struct EmbeddingType {
return ss.str();
}

// template <>
// inline std::string Embedding2StringInternal<float>(const EmbeddingType &embedding, size_t dimension) {
// char buf[6 * dimension * 2];
// std::stringstream ss(buf, std::ios::in | std::ios::out | std::ios::binary);
// for (size_t i = 0; i < dimension - 1; ++i) {
// char buffer[20];
// auto [ptr, ec] = std::to_chars(buffer, buffer + sizeof(buffer), ((float *)(embedding.ptr))[i], std::chars_format::general, 6);
// ss.write((const char *)buffer, ptr - buffer);
// ss.put(',');
// }
// char buffer[20];
// auto [ptr, ec] = std::to_chars(buffer, buffer + sizeof(buffer), ((float *)(embedding.ptr))[dimension - 1], std::chars_format::general, 6);
// ss.write((const char *)buffer, ptr - buffer);
// return ss.str();

// }
template <>
inline std::string Embedding2StringInternal<float>(const EmbeddingType &embedding, size_t dimension) {
std::stringstream ss;
for (size_t i = 0; i < dimension - 1; ++i) {
char buffer[20];
auto [ptr, ec] = std::to_chars(buffer, buffer + sizeof(buffer), ((float *)(embedding.ptr))[i], std::chars_format::general, 6);
ss.write((const char *)buffer, ptr - buffer);
ss.put(',');
}
char buffer[20];
auto [ptr, ec] = std::to_chars(buffer, buffer + sizeof(buffer), ((float *)(embedding.ptr))[dimension - 1], std::chars_format::general, 6);
ss.write((const char *)buffer, ptr - buffer);
return ss.str();
}

[[nodiscard]] static inline std::string BitmapEmbedding2StringInternal(const EmbeddingType &embedding, size_t dimension) {
// TODO: This is for bitmap, and high-performance implementation is needed here.
Expand Down