Comments (1)
I solved this problem by modifying the accelerate package following this link: https://github.com/huggingface/accelerate/pull/2227/files
also found from this link: https://github.com/huggingface/accelerate/issues/2226
hope it helps
but another problem appeared:
my code:
charts = lida.visualize(summary=summary, goal=goals, textgen_config=textgen_config, library=library)
Error messages:
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[12], line 1
----> 1 charts = lida.visualize(summary=summary, goal=goals, textgen_config=textgen_config, library=library)
File /opt/homebrew/lib/python3.11/site-packages/lida/components/manager.py:202, in Manager.visualize(self, summary, goal, textgen_config, library, return_error)
199 goal = Goal(question=goal, visualization=goal, rationale="")
201 self.check_textgen(config=textgen_config)
--> 202 code_specs = self.vizgen.generate(
203 summary=summary, goal=goal, textgen_config=textgen_config, text_gen=self.text_gen,
204 library=library)
205 charts = self.execute(
206 code_specs=code_specs,
207 data=self.data,
(...)
210 return_error=return_error,
211 )
212 return charts
File /opt/homebrew/lib/python3.11/site-packages/lida/components/viz/vizgenerator.py:27, in VizGenerator.generate(self, summary, goal, textgen_config, text_gen, library)
23 def generate(self, summary: Dict, goal: Goal,
24 textgen_config: TextGenerationConfig, text_gen: TextGenerator, library='altair'):
25 """Generate visualization code given a summary and a goal"""
---> 27 library_template, library_instructions = self.scaffold.get_template(goal, library)
28 messages = [
29 {"role": "system", "content": system_prompt},
30 {"role": "system", "content": f"The dataset summary is : {summary} \n\n"},
(...)
33 "content":
34 f"Always add a legend with various colors where appropriate. The visualization code MUST only use data fields that exist in the dataset (field_names) or fields that are transformations based on existing field_names). Only use variables that have been defined in the code or are in the dataset summary. You MUST return a FULL PYTHON PROGRAM ENCLOSED IN BACKTICKS ``` that starts with an import statement. DO NOT add any explanation. \n\n THE GENERATED CODE SOLUTION SHOULD BE CREATED BY MODIFYING THE SPECIFIED PARTS OF THE TEMPLATE BELOW \n\n {library_template} \n\n.The FINAL COMPLETED CODE BASED ON THE TEMPLATE above is ... \n\n"}]
36 completions: TextGenerationResponse = text_gen.generate(
37 messages=messages, config=textgen_config)
File /opt/homebrew/lib/python3.11/site-packages/lida/components/scaffold.py:21, in ChartScaffold.get_template(self, goal, library)
19 def get_template(self, goal: Goal, library: str):
---> 21 general_instructions = f"If the solution requires a single value (e.g. max, min, median, first, last etc), ALWAYS add a line (axvline or axhline) to the chart, ALWAYS with a legend containing the single value (formatted with 0.2F). If using a where semantic_type=date, YOU MUST APPLY the following transform before using that column i) convert date fields to date types using data[''] = pd.to_datetime(data[], errors='coerce'), ALWAYS use errors='coerce' ii) drop the rows with NaT values data = data[pd.notna(data[])] iii) convert field to right time format for plotting. ALWAYS make sure the x-axis labels are legible (e.g., rotate when needed). Solve the task carefully by completing ONLY the AND section. Given the dataset summary, the plot(data) method should generate a {library} chart ({goal.visualization}) that addresses this goal: {goal.question}. DO NOT WRITE ANY CODE TO LOAD THE DATA. The data is already loaded and available in the variable data."
23 matplotlib_instructions = f" {general_instructions} DO NOT include plt.show(). The plot method must return a matplotlib object (plt). Think step by step. \n"
25 if library == "matplotlib":
AttributeError: 'list' object has no attribute 'visualization'`
Still solving.
from lida.
Related Issues (20)
- Can it run in Azure function or Azure WebApp HOT 1
- Have some questions regarding new claude models and the cost per process on LIDA!
- I have tried with lida version 0.0.11 and now i am facing some error with lida 0.0.14
- Plotly Library is not working with LIDA
- Unexpected keyword argument 'base_api' HOT 1
- ValidationError: 1 validation error for Goal visualization str type expected (type=type_error.str)
- Lots of error when runing from sample notebook HOT 2
- Infographer input output
- codellama/CodeLlama-7b-hf
- Generating interactive d3.js charts HOT 1
- Error handling when generating a visualization and repairing it
- How to use LIDA with AWS Bedrock?
- Why "LIDA depends on openAI"? HOT 1
- Lida Summarizer, data type convertion error HOT 2
- Streaming ! ''Does Lida support Streaming of generated content such as goals and summary?"
- How to get or return the output data used to generate the visualization?
- Update Dockerfile to Install Additional Dependencies
- OpenAITextGenerator.__init__() got an unexpected keyword argument 'api_base' HOT 1
- Plotly is not working
- Errors @ docker compose up: HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lida.