thảo luận Deepseek AI vào hết đây

  • Người tạo chủ đề Người tạo chủ đề Zaunite
  • Ngày bắt đầu Ngày bắt đầu
N42yWax.png


via theNEXTvoz for iPhone
 
Deepseek dùng assembly thì lại càng lock với vendor nó viết, fen không hiểu hay giả vờ vậy.
Tôi train model bằng mấy thằng thư viện thì card nào cũng nhảy, cpu gpu gì chạy cũng được vì cơ bản thư viện đó đã có wrapper hết rồi, còn fen optimize perf, viết bằng assembly thì chỉ có cái hệ fen viết là run được thôi vì fen phải viết bằng architecture đó, theo specs của architecture đó.
Có ngược ko vậy, thằng cuda dính với nvidia, độc quyền, hệ khác làm gì chạy dc, còn asm thì open, ai thích thì port qua hệ khác dc mà, thiếu gì dev port dc, cộng đông đầy ra
 
Con hàng này chỉ prompt 1 câu "Create sankey chart in streamlit" mà nó reasoning dài như 1 cái sớ rồi mới code
V092S5K.gif

Okay, I need to help the user create a Sankey chart in Streamlit. Let me start by recalling what I know about Streamlit and Sankey charts.


First, Streamlit is a framework for building web apps with Python. It's pretty straightforward for data apps. Now, Sankey charts are flow diagrams that show the movement or flow between nodes. They're useful for visualizing things like energy distribution, budget flows, etc.



I remember that Streamlit itself doesn't have a native Sankey chart component, but it supports various plotting libraries. The user probably wants to use a Sankey within a Streamlit app, so I need to figure out which libraries can generate a Sankey and integrate with Streamlit.



The main plotting libraries I know are Matplotlib, Plotly, and Altair. Let's think about each:



1. Matplotlib: It has a Sankey function in matplotlib.sankey, but I've heard it's a bit low-level and might be cumbersome for complex diagrams. Also, integrating it into Streamlit would involve rendering a static image, which is possible but maybe not interactive.



2. Plotly: Plotly Express has a Sankey chart built-in, and Plotly charts are interactive. Streamlit supports Plotly via st.plotly_chart(), so this seems like a good option. The user would need to structure their data into nodes and links, which might require some data manipulation.



3. Altair: Altair can create Sankey diagrams too, but it's more involved. You have to structure the data with nodes and links, calculate positions, etc. It might be more work than using Plotly.



Given that, I think the easiest approach is to use Plotly's Sankey diagram. Let me outline the steps the user would need to take:



1. Install Plotly and Streamlit if not already installed.

2. Import necessary libraries in the script.

3. Prepare the data in the format required by Plotly's Sankey: nodes and links. Nodes are the unique entities, and links define the connections with source, target, and value.

4. Create the Sankey figure using Plotly.

5. Display the figure in Streamlit using st.plotly_chart().



Let me think about a sample dataset. For simplicity, maybe a basic example showing energy flow from sources to uses. The nodes could be ['Solar', 'Wind', 'Gas', 'Residential', 'Commercial', 'Industrial'], and links connect sources to uses with some values.



Wait, in the nodes list, each node needs to be assigned an index. The links then refer to these indices. For example, if 'Solar' is index 0, 'Wind' is 1, 'Gas' is 2, and the targets start from 3 (Residential=3, Commercial=4, Industrial=5), the links would have source [0,1,2,...] and target [3,4,5,...], with corresponding values.



So, the user needs to structure their data accordingly. They can either hardcode a small example or read data from a CSV, maybe using pandas.



Let me sketch out the code structure:



- Import streamlit and plotly.express.

- Define nodes and links.

- Create the Sankey figure with px.sankey.

- Use st.plotly_chart(fig).



Potential issues to consider: Ensuring that the node indices in links match the nodes list. Also, handling larger datasets might require dynamic data processing, but for a simple example, hardcoding is fine.



Another thing: The nodes can be a list of strings, and Plotly will handle their indices automatically if you pass them as such. Wait, no. Let me check Plotly's documentation. Oh right, in Plotly Express's Sankey function, you can specify the nodes as a list of labels, and the links are defined by source and target indices. So the user needs to map each node name to an index.



Wait, maybe there's a way to pass the node names directly. Let me think. For example, in Plotly Express, the sankey function (I think it's under go.Figure in the graph objects for more control) requires that the nodes are defined with labels, and the links use the indices. So the user has to create a list of unique node labels, then in the links, specify the source and target as the indices of those labels.



Yes, that's right. So for example:



nodes = ['A', 'B', 'C', 'D']



Then a link from A to C would have source=0, target=2.



So the user needs to prepare the data accordingly.



Putting it all together, here's a step-by-step plan:



1. Install Plotly and Streamlit.

2. Create a new Python file (e.g., sankey_app.py).

3. Import the necessary libraries.

4. Define the nodes and links.

5. Create the Sankey figure using Plotly.

6. Use Streamlit to render the figure.



Let me write a sample code snippet.



Sample code:



import streamlit as st

import plotly.graph_objects as go



# Define nodes

nodes = ['Solar', 'Wind', 'Gas', 'Residential', 'Commercial', 'Industrial']



# Define links with source, target, value

links = {

'source': [0, 1, 2, 0, 1, 2, 3, 4], # Indices correspond to nodes

'target': [3, 3, 3, 4, 4, 4, 5, 5],

'value': [10, 15, 5, 20, 25, 10, 30, 20]

}



# Create the Sankey diagram

fig = go.Figure(data=[go.Sankey(

node=dict(

pad=15,

thickness=20,

line=dict(color="black", width=0.5),

label=nodes

),

link=dict(

source=links['source'],

target=links['target'],

value=links['value']

)

)])



# Update layout if needed

fig.update_layout(title_text="Energy Flow Sankey Diagram", font_size=10)



# Display in Streamlit

st.plotly_chart(fig)



Wait, in this example, the links might not make complete sense. Let me check. For instance, sources are Solar (0), Wind (1), Gas (2), and targets are Residential (3), Commercial (4), Industrial (5). Then, the links are:



- Solar (0) to Residential (3): 10

- Wind (1) to Residential (3):15

- Gas (2) to Residential (3):5

- Solar (0) to Commercial (4):20

- Wind (1) to Commercial (4):25

- Gas (2) to Commercial (4):10

- Then, Residential (3) to Industrial (5):30

- Commercial (4) to Industrial (5):20



That's a bit convoluted, but it's just for example. The main thing is showing how the links work.



Alternatively, maybe a simpler flow. But regardless, the code structure is correct.



So, the user can run this with streamlit run sankey_app.py.



Potential enhancements:



- Allowing users to upload their data (CSV) and generate the Sankey dynamically.

- Adding interactivity, like hover information.

- Customizing colors of nodes or links.



But for the basic example, the above code should suffice.



Another thing to note: The user might get confused between Plotly Express and Graph Objects. In this case, using go.Sankey from graph_objects is necessary because Plotly Express doesn't have a direct Sankey function. Wait, actually, Plotly Express does have a sankey function, but it's part of the experimental module. Let me check.



Upon checking, Plotly Express's Sankey is available via px.sankey, but it's not as straightforward. The documentation shows that you can create a Sankey diagram with px.sankey by specifying the nodes and links. However, using go.Sankey gives more control.



Alternatively, the example I wrote uses go.Sankey, which is correct.



So, the code is okay.



Testing this code would show a Sankey diagram in the Streamlit app. The user can interact with it, like hovering to see values, dragging nodes, etc.



So, summarizing the steps for the user: Install the libraries, create the script with the code, run it with Streamlit.
 
Ko biết bên tàu chính phủ có chính sách gì, có ban hành nghị quyết, chương trình hành động để phát triển trí tuệ nhân tạo, đột phá khoa học ko mà tụi nó đi tắt đón đầu kinh thế :surrender:
 
Nghiên cứu tìm cách khai thác tài nguyên giá rẻ đi, chat hỏi mấy cái linh tinh làm gì
g3wDD5m.png


6797178d196626c409850fca
vãi cả anh hàng xóm, anh phá giá xong bóc mẽ cho cả thế giới thấy bọn tech âu mẽo nó đang bơm thổi thế nào hỏi sao thị trường không suy sụp : ))))) tiết kiệm gì mà 96 98% thì có 1 chục cái áp thuế của chum cũng chơi kg lại : )))))
 
Có ngược ko vậy, thằng cuda dính với nvidia, độc quyền, hệ khác làm gì chạy dc, còn asm thì open, ai thích thì port qua hệ khác dc mà, thiếu gì dev port dc, cộng đông đầy ra
Fen kia bảo deepseek viết bằng assembly không bị vendor lock nên mình mắc cười thôi. Nói OpenAI bị vendor-locked Nvidia
Bọn DeepSeek cũng chạy trên AMD luôn chứ ko riêng gì Nvidia.

Có cả chạy trên Huawei Ascend nữa, thay thế Nvidia luôn nếu có thể:

Còn OpenAI kia hiện tại chỉ biết là chạy trên nền Nvidia thôi chứ các nền khác chưa biết.
Bản thân bọn nó đều train trên thư viện viết bằng python hết nên model train xong chạy trên nền nào chả được?
Còn đem chuyện assembly vào thì hài vl vì các checkpoint khi nó train ra thì export ra nền nào nó chạy nền đó thôi. Cái quan trọng ở đây không phải là vendor-locked mà là compute power + training data. Còn vendor-locked là chuyện không tồn tại ở đây. Nvidia đang là thằng hiệu quả nhất nên openai nó dùng và cả thằng deepseek cũng đang dùng lén, nó không thể công bố t có 50k cái h100 được vì nó đang bị tariff.
 
Chấp nhận thôi, chú là người dẫn đầu, lại là người duy nhất mẹ luôn, giờ chú thổi như nào là quyền của chú.
K4Hcd5N.png

Nhờ có các pháp sư trung hoa mà chúng ta mới được xài đồ rẻ, được phổ cập toàn dân.
6l22n1x.png
Thật ra thì quả này cũng đánh vào 3 bộ chén thánh của Nvidia đấy, nhưng ko mạnh thôi chủ yếu là bớt thổi giá "phần cứng".
Bữa tôi đọc là các pháp sư đang có ý định đánh vào cái "kết nối" trong training AI của Nvidia = 1 giao thức mới luôn, nhưng nghe hơi phiêu lưu :sweat:
 
Ko biết bên tàu chính phủ có chính sách gì, có ban hành nghị quyết, chương trình hành động để phát triển trí tuệ nhân tạo, đột phá khoa học ko mà tụi nó đi tắt đón đầu kinh thế :surrender:
Từ đầu thập niên 2000 đến nay 25 năm du học sinh Trung Quốc nó đã sang Mĩ học và nghiên cứu AI rồi fen. Để ý các paper đều xuất hiện mấy cái tên rất là Tàu, giờ thì họ trở về xây dựng thôi. Ko có đi tắt đón đầu như xứ kia đâu
1nW25IQ.png
 
Fen kia bảo deepseek viết bằng assembly không bị vendor lock nên mình mắc cười thôi. Nói OpenAI bị vendor-locked Nvidia

Bản thân bọn nó đều train trên thư viện viết bằng python hết nên model train xong chạy trên nền nào chả được?
Còn đem chuyện assembly vào thì hài vl vì các checkpoint khi nó train ra thì export ra nền nào nó chạy nền đó thôi. Cái quan trọng ở đây không phải là vendor-locked mà là compute power + training data. Còn vendor-locked là chuyện không tồn tại ở đây. Nvidia đang là thằng hiệu quả nhất nên openai nó dùng và cả thằng deepseek cũng đang dùng lén, nó không thể công bố t có 50k cái h100 được vì nó đang bị tariff.
50000 con h100 là 2 tỏi U đó thím nghe đ hợp lý lắm. Ngang datacenter bytedance đấy
 
Tôi thấy ông kia nói chả có gì sai
Thực tiễn toàn mấy ông mõm chứ có được như tq đâu
Từ bao giờ nói những cái này là ko tốt vậy ?

via theNEXTvoz for iPhone
anh ơi trí tuệ thì nó cũng giống như vũ lực thôi,ai nghĩ đế chế Mông Cổ rộng lớn xa xưa nay lại bị o ép,mất diện tích lãnh thổ và còn chỉ còn một nhúm dân nào.
giữa các dân tộc, chủng tộc cũng vậy,có điểm mạnh và điểm yếu khác nhau chỉ là tùy thời mà phát huy.
 

Thống kê chủ đề

Ngày tạo
Zaunite,
Người trả lời cuối
Jaeho Kouki,
Trả lời
2.993
Lượt xem
519.793
Quay lại
Lên đầu trang