shubhammukherjee commited on
Commit
f7687c4
·
verified ·
1 Parent(s): 7192351
Files changed (1) hide show
  1. app.py +32 -20
app.py CHANGED
@@ -1,25 +1,37 @@
1
- import streamlit as st
2
- from transformers import pipeline
3
 
4
- # Initialize the summarizer pipeline
5
- summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
 
 
 
6
 
7
- def summarize_text(text):
8
- summary = summarizer(text, max_length=150, min_length=50, do_sample=False)
9
- return summary[0]['summary_text']
 
 
 
 
10
 
11
- # Streamlit app layout
12
- st.title("Text Summarizer")
13
- st.write("This app uses Hugging Face's transformers to summarize any text you provide.")
14
 
15
- # User input
16
- input_text = st.text_area("Enter Text to Summarize", height=200)
 
 
17
 
18
- if st.button("Summarize"):
19
- if input_text:
20
- with st.spinner("Summarizing..."):
21
- summary = summarize_text(input_text)
22
- st.subheader("Summary:")
23
- st.write(summary)
24
- else:
25
- st.warning("Please enter some text to summarize.")
 
 
 
 
 
 
1
+ import bpy
 
2
 
3
+ # Set up a basic scene with a camera and light
4
+ def setup_scene():
5
+ # Clear existing objects
6
+ bpy.ops.object.select_all(action='SELECT')
7
+ bpy.ops.object.delete()
8
 
9
+ # Add a camera
10
+ bpy.ops.object.camera_add(location=(0, -5, 3))
11
+ camera = bpy.context.active_object
12
+ camera.rotation_euler = (1.109, 0, 0)
13
+
14
+ # Set the camera as active
15
+ bpy.context.scene.camera = camera
16
 
17
+ # Add a light source
18
+ bpy.ops.object.light_add(type='POINT', location=(0, 0, 5))
 
19
 
20
+ # Add a cube to animate
21
+ bpy.ops.mesh.primitive_cube_add(location=(0, 0, 0))
22
+ cube = bpy.context.active_object
23
+ cube.name = 'Cube'
24
 
25
+ # Keyframe animation (for example, move the cube)
26
+ cube.location = (0, 0, 0)
27
+ cube.keyframe_insert(data_path="location", frame=1)
28
+
29
+ cube.location = (5, 5, 0)
30
+ cube.keyframe_insert(data_path="location", frame=50)
31
+
32
+ # Set the frame range for the animation
33
+ bpy.context.scene.frame_start = 1
34
+ bpy.context.scene.frame_end = 50
35
+
36
+ # Execute the setup function
37
+ setup_scene()