Git Product home page Git Product logo

elasticdocs_gpt's People

Contributors

jeffvestal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elasticdocs_gpt's Issues

IndexError: list index out of range

I am receiving the following error when trying to query something using the ElasticGPT python app.

IndexError: list index out of range

This is what the app returns in the Traceback

Traceback (most recent call last):

  File "/home/user/ElasticDocs_GPT/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)
  File "/home/user/ElasticDocs_GPT/elasticdocs_gpt.py", line 110, in <module>
    resp, url = search(query)
  File "/home/user/ElasticDocs_GPT/elasticdocs_gpt.py", line 77, in search
    body = resp['hits']['hits'][0]['fields']['body_content'][0]

I have set this up exactly from the instructions on the blog article. I have also attempted different versions of urllib3 and requests libraries but that did not change anything. Any assistance would be much appreciated.

Problem starting the model

Hey, I went through all the steps, but at the start of the model I get an error.

>>> m = MlClient.get_trained_models(es, model_id=es_model_id)
>>> m.body
{'count': 1, 'trained_model_configs': [{'model_id': 'sentence-transformers__all-distilroberta-v1', 'model_type': 'pytorch', 'created_by': 'api_user', 'version': '8.8.0', 'create_time': 1686169940288, 'model_size_bytes': 0, 'estimated_operations': 0, 'license_level': 'platinum', 'description': "Model sentence-transformers/all-distilroberta-v1 for task type 'text_embedding'", 'tags': [], 'input': {'field_names': ['text_field']}, 'inference_config': {'text_embedding': {'vocabulary': {'index': '.ml-inference-native-000001'}, 'tokenization': {'roberta': {'do_lower_case': False, 'with_special_tokens': True, 'max_sequence_length': 512, 'truncate': 'first', 'span': -1, 'add_prefix_space': False}}}}, 'location': {'index': {'name': '.ml-inference-native-000001'}}}]}
>>> s = MlClient.start_trained_model_deployment(es, model_id=es_model_id)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/macbook-air-665/Library/Python/3.8/lib/python/site-packages/elasticsearch/_sync/client/utils.py", line 414, in wrapped
    return api(*args, **kwargs)
  File "/Users/macbook-air-665/Library/Python/3.8/lib/python/site-packages/elasticsearch/_sync/client/ml.py", line 3792, in start_trained_model_deployment
    return self.perform_request(  # type: ignore[return-value]
  File "/Users/macbook-air-665/Library/Python/3.8/lib/python/site-packages/elasticsearch/_sync/client/_base.py", line 320, in perform_request
    raise HTTP_EXCEPTIONS.get(meta.status, ApiError)(
elasticsearch.BadRequestError: BadRequestError(400, 'status_exception', 'Model definition truncated. Unable to deserialize trained model definition [sentence-transformers__all-distilroberta-v1]')
>>> 

IndexError: list index out of range

Getting a list index out of range error, as below:

File "C:\PyProjects\elastic-ChatGPT\rsllc-elastic-env\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 541, in _run_script exec(code, module.__dict__) File "C:\PyProjects\elastic-ChatGPT\elastic-gpt.py", line 116, in <module> resp, url = search(query) File "C:\PyProjects\elastic-ChatGPT\elastic-gpt.py", line 83, in search body = resp['hits']['hits'][0]['fields']['body_content'][0]

The error is happening in the streamlit script for the line
body = resp['hits']['hits'][0]['fields']['body_content'][0]

The output of
resp = es.search(index=index, query=query, knn=knn, fields=fields, size=1, source=False)
is
{'took': 44, 'timed_out': False, '_shards': {'total': 2, 'successful': 2, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 0, 'relation': 'eq'}, 'max_score': None, 'hits': []}}

I've followed the instructions in the blog but unsure why getting a list index out of range

ConflictError

Hi Team,

I have done all configurations for integrating chatgpt with elasticsearch. It was working but after some hours when i was not using it. It shown me below error

 line 321, in perform_request
    raise HTTP_EXCEPTIONS.get(meta.status, ApiError)(
elasticsearch.ConflictError: ConflictError(409, 'status_exception', 'Trained model deployment [sentence-transformers__all-distilroberta-v1] is not allocated to any nodes')

Why it is coming what does that means

Versions missing for python libraries

Executing the first line of the notebook pip -q install eland elasticsearch sentence_transformers transformers torch==1.11 in Google Colab we get:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torchaudio 2.1.0+cu118 requires torch==2.1.0, but you have torch 1.11.0 which is incompatible.
torchdata 0.7.0 requires torch==2.1.0, but you have torch 1.11.0 which is incompatible.
torchtext 0.16.0 requires torch==2.1.0, but you have torch 1.11.0 which is incompatible.

Only the torch library version is specified. I suppose that the other libraries have evolved with dependencies on upper versions of torch. Does anybody know what is the right version for those libraries to work with torch==1.11?

Setting those versions in the first execution line may solve the issue.

i am trying to integrata with local elasticsearch

i am getting this Error:
UnsupportedProductError: The client noticed that the server is not Elasticsearch and we do not support this unknown product
{
"version" : {
"number" : "7.10.2",
"build_flavor" : "oss",
"build_type" : "rpm",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

and the modification for the script...

def es_connect(url, user, passwd):
# Establecer la URL y las credenciales de autenticación
url = "https://localhost:9200" # URL del clúster local
user = "" # Nombre de usuario para acceder al clúster
passwd = "" # Contraseña para acceder al clúster

# Crear una instancia de Elasticsearch
es = Elasticsearch(url, http_auth=(user, passwd),
    verify_certs=False)

# Realizar alguna operación en el clúster, por ejemplo, obtener información de clúster
cluster_info = es.cluster.health()

# Retornar la conexión establecida
return es

Search ElasticSearch index and return body and URL of the result

def search(query_text):
url = "https://localhost:9200" # URL del clúster local
user = "" # Nombre de usuario para acceder al clúster
passwd = "" # Contraseña para acceder al clúster
es = es_connect(url, user, passwd)
verify_certs=False

i think that the error comes from the oss flavour not suported....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.