Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,89 +40,36 @@ scheduler.start()
|
|
| 40 |
# Initial authentication
|
| 41 |
refresh_authentication()
|
| 42 |
|
| 43 |
-
Article =
|
| 44 |
"class": "Article",
|
| 45 |
"description": "A class representing articles in the application",
|
| 46 |
-
"vectorIndexType": "hnsw",
|
| 47 |
-
"vectorIndexConfig": {
|
| 48 |
-
},
|
| 49 |
-
"vectorizer": "text2vec-contextionary",
|
| 50 |
-
"moduleConfig": {
|
| 51 |
-
"text2vec-contextionary": {
|
| 52 |
-
"vectorizeClassName": True
|
| 53 |
-
}
|
| 54 |
-
},
|
| 55 |
"properties": [
|
| 56 |
{
|
| 57 |
"name": "title",
|
| 58 |
"description": "The title of the article",
|
| 59 |
-
"dataType": ["text"]
|
| 60 |
-
"moduleConfig": {
|
| 61 |
-
"text2vec-contextionary": {
|
| 62 |
-
"skip": False,
|
| 63 |
-
"vectorizePropertyName": True
|
| 64 |
-
}
|
| 65 |
-
}
|
| 66 |
-
# ,"indexFilterable": True,
|
| 67 |
-
# "indexSearchable": True
|
| 68 |
},
|
| 69 |
{
|
| 70 |
"name": "content",
|
| 71 |
"description": "The content of the article",
|
| 72 |
-
"dataType": ["text"]
|
| 73 |
-
"moduleConfig": {
|
| 74 |
-
"text2vec-contextionary": {
|
| 75 |
-
"skip": False,
|
| 76 |
-
"vectorizePropertyName": True
|
| 77 |
-
}
|
| 78 |
-
}
|
| 79 |
-
# , "indexFilterable": True #,
|
| 80 |
-
# "indexSearchable": True
|
| 81 |
},
|
| 82 |
{
|
| 83 |
"name": "author",
|
| 84 |
"description": "The author of the article",
|
| 85 |
"dataType": ["text"]
|
| 86 |
-
# , "indexFilterable": True,
|
| 87 |
-
# "indexSearchable": True
|
| 88 |
},
|
| 89 |
{
|
| 90 |
"name": "publishDate",
|
| 91 |
"description": "The date the article was published",
|
| 92 |
"dataType": ["date"]
|
| 93 |
-
# , "indexFilterable": True,
|
| 94 |
-
# "indexSearchable": True
|
| 95 |
}
|
| 96 |
],
|
| 97 |
-
"
|
| 98 |
-
|
| 99 |
-
"preset": "en",
|
| 100 |
-
"additions": [],
|
| 101 |
-
"removals": []
|
| 102 |
-
},
|
| 103 |
-
"indexTimestamps": True,
|
| 104 |
-
"indexNullState": True,
|
| 105 |
-
"indexPropertyLength": True,
|
| 106 |
-
"bm25": {
|
| 107 |
-
"b": 0.75,
|
| 108 |
-
"k1": 1.2
|
| 109 |
-
}
|
| 110 |
-
},
|
| 111 |
-
"shardingConfig": {
|
| 112 |
-
"virtualPerPhysical": 128,
|
| 113 |
-
"desiredCount": 1,
|
| 114 |
-
"actualCount": 1,
|
| 115 |
-
"desiredVirtualCount": 128,
|
| 116 |
-
"actualVirtualCount": 128,
|
| 117 |
-
"key": "_id",
|
| 118 |
-
"strategy": "hash",
|
| 119 |
-
"function": "murmur3"
|
| 120 |
-
},
|
| 121 |
-
"multiTenancyConfig": {
|
| 122 |
-
"enabled": False
|
| 123 |
-
}
|
| 124 |
}
|
| 125 |
|
|
|
|
| 126 |
schema = {
|
| 127 |
"classes": [Article]
|
| 128 |
}
|
|
|
|
| 40 |
# Initial authentication
|
| 41 |
refresh_authentication()
|
| 42 |
|
| 43 |
+
Article = {
|
| 44 |
"class": "Article",
|
| 45 |
"description": "A class representing articles in the application",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
"properties": [
|
| 47 |
{
|
| 48 |
"name": "title",
|
| 49 |
"description": "The title of the article",
|
| 50 |
+
"dataType": ["text"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
},
|
| 52 |
{
|
| 53 |
"name": "content",
|
| 54 |
"description": "The content of the article",
|
| 55 |
+
"dataType": ["text"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
},
|
| 57 |
{
|
| 58 |
"name": "author",
|
| 59 |
"description": "The author of the article",
|
| 60 |
"dataType": ["text"]
|
|
|
|
|
|
|
| 61 |
},
|
| 62 |
{
|
| 63 |
"name": "publishDate",
|
| 64 |
"description": "The date the article was published",
|
| 65 |
"dataType": ["date"]
|
|
|
|
|
|
|
| 66 |
}
|
| 67 |
],
|
| 68 |
+
"vectorIndexType": "hnsw",
|
| 69 |
+
"vectorizer": "text2vec-contextionary"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
}
|
| 71 |
|
| 72 |
+
|
| 73 |
schema = {
|
| 74 |
"classes": [Article]
|
| 75 |
}
|