Spaces:
GIZ
/
Running on CPU Upgrade

ppsingh commited on
Commit
2dcf249
·
1 Parent(s): f9f731c

Readme and Disclaimer update

Browse files
README.md CHANGED
@@ -30,7 +30,7 @@ license: apache-2.0
30
 
31
  Gina Bot is an AI-powered conversational assistant designed to help you understand compliance with and analyze the Circular Economy topic. This tool leverages advanced language models to help you get clear and structured answers about Circular Economy requirements, compliance procedures, and regulatory guidance.
32
 
33
- It combines a generative language assistant with a knowledge base implemented via Retrieval-Augmented Generation (RAG). The scope and functionality of the tool is focused on EU Deforestation Regulation compliance and related documentation.
34
 
35
  ## 2. Models Used
36
 
@@ -71,14 +71,14 @@ All the models mentioned above are being consumed without any fine-tuning or tra
71
  - The user interface clearly indicates the use of a generative AI model.
72
  - An explanation of the RAG method is included.
73
  - We collect usage statistics as detailed in Disclaimer tab of the app along with the explicit display in the user interface of the tool.
74
- - Feedback mechanism available (via https://huggingface.co/spaces/GIZ/gina_dev/discussions/new).
75
 
76
  ## 7. Monitoring, Feedback, and Incident Reporting
77
 
78
- - User can provide feedback via UI by giving (Thumbs-up or down to AI-Generated answer). Alternatively for more detailed feedback please use https://huggingface.co/spaces/GIZ/gina_dev/discussions/new to report any issue.
79
  - Technical development is carried out by the GIZ Data Service Center.
80
  - No automated bias detection – but low risk due to content restrictions.
81
 
82
  ## 8. Contact
83
 
84
- For any questions, please contact via https://huggingface.co/spaces/GIZ/gina_dev/discussions/new or send us email to dataservicecenter@giz.de
 
30
 
31
  Gina Bot is an AI-powered conversational assistant designed to help you understand compliance with and analyze the Circular Economy topic. This tool leverages advanced language models to help you get clear and structured answers about Circular Economy requirements, compliance procedures, and regulatory guidance.
32
 
33
+ It combines a generative language assistant with a knowledge base implemented via Retrieval-Augmented Generation (RAG). The scope and functionality of the tool is focused on specific document database collected by team on topic of 'Circular Economy' in context of Colombia.
34
 
35
  ## 2. Models Used
36
 
 
71
  - The user interface clearly indicates the use of a generative AI model.
72
  - An explanation of the RAG method is included.
73
  - We collect usage statistics as detailed in Disclaimer tab of the app along with the explicit display in the user interface of the tool.
74
+ - Feedback mechanism available (via https://huggingface.co/spaces/GIZ/gina/discussions/new).
75
 
76
  ## 7. Monitoring, Feedback, and Incident Reporting
77
 
78
+ - User can provide feedback via UI by giving (Thumbs-up or down to AI-Generated answer). Alternatively for more detailed feedback please use https://huggingface.co/spaces/GIZ/gina/discussions/new to report any issue.
79
  - Technical development is carried out by the GIZ Data Service Center.
80
  - No automated bias detection – but low risk due to content restrictions.
81
 
82
  ## 8. Contact
83
 
84
+ For any questions, please contact via https://huggingface.co/spaces/GIZ/gina/discussions/new or send us email to dataservicecenter@giz.de
app.py CHANGED
@@ -103,6 +103,7 @@ def make_html_source(source,i):
103
 
104
  return card
105
 
 
106
  async def chat_response(query, history, category, request=None):
107
  """Generate chat response based on method and inputs"""
108
 
@@ -123,6 +124,8 @@ async def chat_response(query, history, category, request=None):
123
  # Generate response
124
  response = await generate(query=query, context=context_retrieved_lst)
125
 
 
 
126
  # Log the interaction
127
  try:
128
  chat_logger.log(
@@ -134,9 +137,10 @@ async def chat_response(query, history, category, request=None):
134
  except Exception as e:
135
  print(f"Logging error: {str(e)}")
136
 
 
137
  # Stream response character by character
138
  displayed_response = ""
139
- for i, char in enumerate(response):
140
  displayed_response += char
141
  history[-1] = (query, displayed_response)
142
  yield history, docs_html
@@ -391,8 +395,8 @@ with gr.Blocks(title="Gina Bot", theme=theme, css="style.css") as demo:
391
  - Always consult qualified professionals for official compliance decisions
392
 
393
  ⚠️ **Data & Privacy:**
394
- - We collect usage statistics to improve the tool
395
- - Files are processed temporarily and not permanently stored
396
 
397
  ⚠️ **AI Limitations:**
398
  - Responses are AI-generated and may contain inaccuracies
@@ -402,7 +406,12 @@ with gr.Blocks(title="Gina Bot", theme=theme, css="style.css") as demo:
402
  **Data Collection:** We collect questions, answers, feedback, and anonymized usage statistics
403
  to improve tool performance based on legitimate interest in service enhancement.
404
 
405
- By using this tool, you acknowledge these limitations and agree to use responses responsibly.
 
 
 
 
 
406
  """)
407
 
408
  # Event Handlers
 
103
 
104
  return card
105
 
106
+ BEGINNING_TEXT = "**Respuesta generada mediante inteligencia artificíal:** \n\n"
107
  async def chat_response(query, history, category, request=None):
108
  """Generate chat response based on method and inputs"""
109
 
 
124
  # Generate response
125
  response = await generate(query=query, context=context_retrieved_lst)
126
 
127
+ # Add disclaimer to the response
128
+ response_with_disclaimer = BEGINNING_TEXT + response
129
  # Log the interaction
130
  try:
131
  chat_logger.log(
 
137
  except Exception as e:
138
  print(f"Logging error: {str(e)}")
139
 
140
+
141
  # Stream response character by character
142
  displayed_response = ""
143
+ for i, char in enumerate(response_with_disclaimer):
144
  displayed_response += char
145
  history[-1] = (query, displayed_response)
146
  yield history, docs_html
 
395
  - Always consult qualified professionals for official compliance decisions
396
 
397
  ⚠️ **Data & Privacy:**
398
+ - We collect usage statistics to improve the tool.
399
+ - No personal data is collected when using this tool.
400
 
401
  ⚠️ **AI Limitations:**
402
  - Responses are AI-generated and may contain inaccuracies
 
406
  **Data Collection:** We collect questions, answers, feedback, and anonymized usage statistics
407
  to improve tool performance based on legitimate interest in service enhancement.
408
 
409
+ By using this chatbot, you agree to these terms and acknowledge that you are solely responsible for any reliance on or actions taken based on its responses.
410
+
411
+ **Technical Information**: User can read more about the technical information about the tool in [Readme](https://huggingface.co/spaces/GIZ/gina/blob/main/README.md) of this tool.
412
+
413
+ This is just a prototype and being tested and worked upon, so its not perfect and may sometimes give irrelevant answers. If you are not satisfied with the answer, please ask a more specific question or report your feedback to help us improve the system.
414
+
415
  """)
416
 
417
  # Event Handlers
utils/__pycache__/generator.cpython-310.pyc ADDED
Binary file (6.2 kB). View file
 
utils/__pycache__/logger.cpython-310.pyc ADDED
Binary file (5 kB). View file
 
utils/__pycache__/retriever.cpython-310.pyc ADDED
Binary file (972 Bytes). View file